# Android 14 Migration guide

## 1 - Check major changes

Android offers a clear and exhaustive [documentation](https://developer.android.com/about/versions/14) listing the new features and changes related to Android 14.

It is necessary to read this documentation **before** modifying any code in your project.

{% hint style="warning" %}
You must consider the two main categories of behaviours changes related to Android 14:

* [Behavior changes: all apps](https://developer.android.com/about/versions/14/behavior-changes-all)
* [Behavior changes: Apps targeting Android 14 or higher](https://developer.android.com/about/versions/14/behavior-changes-14)
  {% endhint %}

## 2 - Targeting Android 14 in your project

To make your app fully compatible with Android 14, update the `targetSdkVersion` and `compileSdkVersion` to `34` in your project app.

## 3 - Apply changes ("All Apps" and "Apps targeting Android 14")

It's now time to update your code once the previous steps are taken into account.

DriveQuant recommends to specifically pay attention about these topics that can lead to a runtime crash:

* [Foreground services type are required](https://developer.android.com/about/versions/14/changes/fgs-types-required)
* [Restrictions to implicit and pending intents](https://developer.android.com/about/versions/14/behavior-changes-14#safer-intents)

## 4 - Update the DriveKit SDK

After you have checked that your project is working properly and updated the `targetSdkVersion` and `compileSdkVersion`, you need to update the DriveKit SDK.

* DriveKit internal modules that support Android 14 are versions **1.35** and above.
* DriveKit UI modules that support Android 14 are versions **1.39** and above.&#x20;

{% hint style="info" %}
The latest DriveKit versions are listed in the changelog:

* [For internal modules](/release-notes/changelog/android.md)&#x20;
* [For UI modules](/release-notes/changelog/ui-android.md)
  {% endhint %}

## 5 - Tests 🚗

The last part is to ensure that the app is working as expected. The best way to do this is to compare your app's behaviour with the [DriveQuant's app](https://play.google.com/store/apps/details?id=com.drivequant) and/or the [DriveKit Demo App](https://github.com/DriveQuantPublic/drivekit-ui-android); which already support Android 14.&#x20;

If you experience any problems with DriveKit, please contact us.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/get-started-drivekit/android/android-14-migration-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
