Strike while the iron is hot

Google releases first Android P developer preview

Gabriela Motroc
Android P

© Shutterstock / Raoraby

Everything is going like clockwork in the Android world. It’s March, which means Google is releasing the first developer preview of the next Android version —Android P.

This first developer preview of Android P has just been released. However, since Dave Burke, Google VP of engineering called this developer preview “an early baseline build for developers only” in the blog post announcing the release, you might want to proceed with caution.

If you’re not interested in reading about all the features that have been included in this first developer preview, here’s a video which should make things more clear.

Android P developer preview: Features

Indoor positioning with Wi-Fi RTT

Android P adds platform support for the IEEE 802.11mc WiFi protocol — you might know it as WiFi Round-Trip-Time (RTT) — which means you can now take advantage of indoor positioning in your apps.

If your Android P device has hardware support, location permission, and location enabled, your apps can use RTT APIs to measure the distance to nearby WiFi Access Points (APs). Furthermore, you won’t have to connect your device to the APs to use RTT and to ensure that your privacy is maintained, only the phone can determine the distance, not the APs.

If you know the distance to minimum three APIs, you can calculate the device position with an accuracy of 1 to 2 meters. This will come in handy if you want to build new experiences such as in-building navigation; fine-grained location-based services such as disambiguated voice control; and location-based information.

Display cutout support

The Android team has added display cutout into the platform, along with APIs that can be used to manage how the content is displayed. You should know that it works seamlessly for apps — the system managing status bar height separates your content from the cutout.

You can also use new APIs to check the cutout shape and request full-screen layout around it. You can check whether the current device has a cutout by calling. To make this easier for you, there’s also a Developer Option that simulates a cutout on any device.

Improved messaging notifications

Android P is all about improving visibility and function in notifications, which is why you are encouraged to try the new MessagingStyle notification style; it highlights who is messaging and how you can reply.

The new notification style can do more than that so check out the details here.

SEE ALSO: 5 mistakes Android developers must avoid

Multi-camera API

If you wanted to access streams simultaneously from two or more physical cameras on devices running Android P, your wish has just been granted. It gets even better if your device has either dual-front or dual-back cameras because you can create innovative features which cannot be achieved with just a single camera.

You can also call a logical or fused camera stream which automatically switches between two or more cameras.

Newer, better

Security for apps

Android now offers a standard system dialog to prompt the user to touch the fingerprint sensor, managing text and placement as appropriate for the device. You can use a new FingerprintDialog API if you want apps to trigger the system fingerprint dialog.

Privacy for users

Android P restricts access to mic, camera, and all SensorManager sensors from idle apps. The team is also working on enabling encryption of Android backups with a client-side secret but it will be launched in a future Android P preview release.

Optimized Kotlin

The team has improved several compiler optimizations, especially those that target loops, to extract better performance and are working with JetBrains to optimize Kotlin’s generated code. All you need to do in order to receive the latest performance improvements is keep Android Studio’s Kotlin plugin up-to-date.

SEE ALSO: Is Oreo better than Nougat?

Targeting modern Android

As Google announced recently, Google Play will require all app updates to target Android Oreo by November 2018 (targetSdkVersion 26 or higher).  Support for 64-bit hardware might be in the cards for 2019.

Therefore, Android P will warn users with a dialog when they install an app which targets a platform earlier than Android 4.2 (targetSdkVersion less than 17). It should be noted that future platform versions will continue to increment that lower bound.

Improving app compatibility through public APIs

Android P introduces a gradual process to restrict access to selected non-SDK interfaces, asking developers to use the public equivalents instead. Learn more about the restrictions is here.

SEE ALSO: Android Studio 3.0: Kotlin support, new Android plugin for Gradle and more

Get started with Android P

  • Make your app compatible to give your users a seamless transition to Android P. All you need to do is download a device system image or emulator system image, install your current app, and test. You’re advised to publish to Google Play right away without changing the app’s platform targeting.

Reminder: you don’t need a supported Pixel device to test or develop on Android P.

  • Change your app’s targeting to “P” and run it with the full Android P experience. Set your app’s targetSdkVersion to ‘P’ and compileSdkVersion to android-P, build, and test. Make sure to read the behavior changes for apps targeting P to find areas you will want to test and might need to adjust.

To get started building with Android P, download the P Developer Preview SDK and tools into Android Studio 3.1 or use the latest Android Studio 3.2 canary version.

Gabriela Motroc
Gabriela Motroc was editor of and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Inline Feedbacks
View all comments