Android P has reached Beta 2 as planned and the final API has been released. You already know enough about the behavioral changes and new features Android P will bring. This article details how to migrate your application to Android P, ensure compatibility, and take advantage of the new features of Android P. Migrate your application as soon as possible to provide users with the latest and most stable experience.

The final API has been released. Has your application been migrated?

Step 1: Make sure Android P is compatible

The goal here is to ensure that your existing application runs on Android P (API level P). Some adjustments may be required because of platform changes that may affect how your application behaves, but you don’t need to use a new API or change targetSdkVersion.

Prepare a device running Android P

  • If you have a compatible device (Pixel, Pixel XL, Pixel 2, Pixel 2XL), please obtain the Android P system image suitable for your device from the download page and then follow the instructions to swipe the image into the device.
  • Or download the Android P system image for Android Emulator. It is listed under Android P Preview of SDK Manager and shows as Google APIs Intel x86 Atom System Image.

Performing compatibility Tests

Compatibility tests with Android P (API level P) are probably the same type of tests you perform when you are preparing to release your application. It is important to review the core application quality guidelines and testing best practices.

However, there is another layer to the testing: Android P introduces some changes to the Android platform that, without making any changes to targetSdkVersion, could affect the behavior of the application or make it not work at all. Therefore, you must review the key changes in Table 1 and test any fixes implemented to accommodate these changes:

△ Table 1. Key changes affecting all applications running on Android P devices

Android P behavior change documentation

Step 2: Update your target version and use Android P features

This section explains how to achieve full support for Android P (API level P) by updating your targetSdkVersion to P and adding new features provided in Android P.

In addition to providing the new API, when you update targetSdkVersion to P, you’ll notice that Android P introduces some behavior changes. Because some behavior changes may require code changes to avoid conflicts, you should first review all behavior changes that apply to applications developed for Android P to see how your application will be affected if you change targetSdkVersion.

Note: The steps above to ensure platform compatibility are prerequisites for building an application for Android P, so make sure you complete them first.

Obtain the Android P SDK

You can use Android Studio 3.1 or later to obtain SDK packages to build applications using Android P (API level P). If you don’t need the new features in Android P for now and just want to compile for that platform version, you can use Android Studio 3.1. Android Studio 3.2 provides full support for Android P features.

Test the Android P app

With that done, you can build your application and then test it further to make sure it works when Android P (API level P) is the target platform. It is worth reviewing the core application quality guidelines and testing best practices mentioned above.

If you build your application with targetSdkVersion set to P, you should be aware of platform-specific changes. Even if you don’t implement the new features in Android P, some of these changes can seriously affect your app’s behavior or make it impossible to run at all. Please refer to Table 2 for details:

△ Table 2. Key changes affecting the application when targetSdkVersion is set to “P”

Android P features and API documentation

Move your app to Android P now and bring more surprises to your users!

Domestic test platform

The specific free time period is decided by the testing platform

Check out WeTest for more information and benefits about Android P developer preview testing