Google today formally announced Android P, after a number of rumors. The first developer preview is here, and Google says that it"s still rough around the edges. This build won"t be released to the Android Beta Program, and you"ll need to flash it manually. It"s also only available for Pixel and Pixel 2 phones, as the Nexus 5X, Nexus 6P, and Pixel C are likely to be dropped from support.
There are lots of new features, and one of the most notable is support for an iPhone X-style notch. Apps can take advantage of the space, and there will be APIs to manage content. There"s also a Developer Option to simulate a notch.
Indoor positioning with Wi-Fi RTT, or 802.11mc, is also new. Devices will be able to see the distance to Wi-Fi access points, meaning that it will be able to tell the location by one to two meters. This should allow for more advanced location-based features.
Once again, Google is trying to improve notifications. Messaging notifications can now highlight who is sending the message, show images, suggest smart replies, and more.
There"s a new multi-camera API that should open up some new possibilities on devices with dual-lens cameras. These new features can include seamless zoom, bokeh, and stereo vision.
You"ll also find support for new image and video formats. HEIF image compression is here, and hopefully this will boost support for the format. Apple started using it by default with iOS 11, but there are still many apps that don"t support it. There"s also support for HDR VP9 video.
Here are some other improvements that Google noted in its massive Android P changelog:
ImageDecoder for bitmaps and drawables
Android P gives you an easier way to decode images to bitmaps or drawables -- ImageDecoder, which deprecates BitmapFactory. ImageDecoder lets you create a bitmap or drawable from a byte buffer, file, or URI. It offers several advantages over BitmapFactory, including support for exact scaling, single-step decoding to hardware memory, support for post-processing in decode, and decoding of animated images.
You can decode and scale to an exact size just by calling setResize() with the target dimensions. You can also call getSampledSize() to get the image dimensions at a specific sample rate, then scale to those dimensions. If you want post-process an image -- such as applying rounded corners for circle masks or more complicated effects -- you can pass ImageDecoder any android.graphics.PostProcessor. You can also create Drawables directly, with ImageDecoder.decodeDrawable(). If the encoded image is an animated GIF or WebP, the Drawable will be an instance of the new AnimatedImageDrawable.
Data cost sensitivity in JobScheduler
JobScheduler is Android"s central service to help you manage scheduled tasks or work across Doze, App Standby, and Background Limits changes. In Android P, JobScheduler handles network-related jobs better for the user, coordinating with network status signals provided separately by carriers.
Jobs can now declare their estimated data size, signal prefetching, and specify detailed network requirements—carriers can report networks as being congested or unmetered. JobScheduler then manages work according to the network status. For example, when a network is congested, JobScheduler might defer large network requests. When unmetered, it can run prefetch jobs to improve the user experience, such as by prefetching headlines.
When you are adding jobs, try using setEstimatedNetworkBytes(), setIsPrefetch() and setRequiredNetwork() to let JobScheduler handle the work properly. When your job executes, be sure to use the Network object returned by JobParameters.getNetwork(), otherwise you"ll implicitly use the device"s default network which may not meet your requirements, causing unintended data usage.
Neural Networks API 1.1
We introduced the Neural Networks API in Android 8.1 to accelerate on-device machine learning on Android. In Android P we"re expanding and improving this API, adding support for nine new ops -- Pad, BatchToSpaceND, SpaceToBatchND, Transpose, Strided Slice, Mean, Div, Sub, and Squeeze. If you have a Pixel 2 device, the DP1 build now includes an Qualcomm Hexagon HVX driver with acceleration for quantized models.
Autofill improvements
In Android P we"re continuing to improve the Autofill Framework based on feedback from users and developers. Along with key bugfixes, this release includes new APIs that allow password managers to improve the Autofill user experience, such as better dataset filtering, input sanitization, and compatibility mode. Compatibility mode in particular has a high impact on end users because it lets password managers take the accessibility-based approach in apps that don"t yet have full Autofill support, but without impacts on performance or security. See all the details on what"s new here.
Open Mobile API for NFC payments and secure transactions
Android P adds an implementation of the GlobalPlatform Open Mobile API to Android. On supported devices, apps can use the OMAPI API to access secure elements (SE) to enable smart-card payments and other secure services. A hardware abstraction layer (HAL) provides the underlying API for enumerating a variety of Secure Elements (eSE, UICC, and others) available.
But that"s still not all. There are plenty of improvements to security, privacy, ART performance, Kotlin optimizations, power efficiency, and more. Images for the preview are available here for the Pixel, Pixel XL, Pixel 2, and Pixel 2 XL.
The next preview will arrive in May, and that will be a beta release. Final APIs will follow in preview 3 in June, with the next two builds being release candidates in June and July. The final update will be made available in the third quarter of 2018.