Sunday, October 21, 2018

Previewing Android P

Posted past times Dave Burke, VP of Engineering

Last calendar week at Mobile World Congress nosotros saw that Android's ecosystem of developers, device makers, together with silicon partners continues to convey amazing experiences to users worldwide.

Looking ahead, today we're sharing the offset developer preview of Android P, the newest version of Android. It's an early on baseline create for developers alone -- you're our most trusted reviewers together with testers ;-) Early feedback from our developer community is crucial inward helping us evolve the platform to encounter your needs. We'd dear to acquire you lot started exercising the novel features together with APIs inward P, together with every bit always, nosotros depend on your early on feedback together with ideas, thus delight give us your input!

This offset developer preview of Android P is merely the start - we'll receive got lots to a greater extent than to portion at Google I/O inward May, remain tuned!

New features to seek inward your apps

Here's a human face at some of the cool features inward this offset preview of Android P that nosotros desire you lot to seek together with give feedback on.

Indoor positioning alongside Wi-Fi RTT

Accurate indoor positioning has been a long-standing challenge that opens novel opportunities for location-based services. Android P adds platform back upwardly for the IEEE 802.11mc WiFi protocol -- also known every bit WiFi Round-Trip-Time (RTT) -- to allow you lot accept wages of indoor positioning inward your apps.

On Android P devices alongside hardware support, location permission, together with location enabled, your apps tin move role RTT APIs to mensurate the distance to nearby WiFi Access Points (APs). The device doesn't demand to connect to the APs to role RTT, together with to maintain privacy, alone the telephone is able to decide the distance, non the APs.

Knowing the distance to three or to a greater extent than APs, you lot tin move calculate the device seat alongside an accuracy of 1 to 2 meters. With this accuracy, you lot tin move create novel experiences similar in-building navigation; fine-grained location-based services such every bit disambiguated vocalization command (e.g.,'Turn on this light'); together with location-based information (e.g., 'Are at that topographic point special offers for this product?').

Display cutout support

Now apps tin move accept total wages of the latest device screens alongside fullscreen content. We've added display cutout into the platform, along alongside APIs that you lot tin move role to acquire by how your content is displayed.

Cutout back upwardly industrial plant seamlessly for apps, alongside the organisation managing condition bar meridian to dissever your content from the cutout. If you lot receive got critical, immersive content, you lot tin move also role new APIs to banking enterprise gibe the cutout shape together with asking full-screen layout around it. You tin move banking enterprise gibe whether the electrical flow device has a cutout past times calling getDisplayCutout(), together with and thus decide the location together with shape of the cutout expanse using DisplayCutout. Influenza A virus subtype H5N1 novel window layout attribute, layoutInDisplayCutoutMode, lets you lot tell the organisation how together with when lay out your content relative to the cutout area. Details are here.

To brand it easier to create together with seek cutout back upwardly inward your app, we've added a Developer Option that simulates a cutout on whatever device. We recommend testing your existing apps alongside display cutout enabled to ensure that your content displays properly.

Apps alongside immersive content tin move display content fullscreen on devices alongside a display cutout.

Improved messaging notifications

In Android P we've pose a priority on improving visibility together with business office inward notifications. Try the novel MessagingStyle notification trend -- it highlights who is messaging together with how you lot tin move reply. You tin move demo conversations, attach photos together with stickers, together with fifty-fifty advise smart replies. See the details here.

In MessagingStyle notifications you lot tin move at nowadays demo conversations together with smart replies [left] together with fifty-fifty attach images together with stickers [right].

Multi-camera API

You tin move at nowadays access streams simultaneously from two or to a greater extent than physical cameras on devices running Android P. On devices alongside either dual-front or dual-back cameras, you lot tin move create innovative features non possible alongside merely a unmarried camera, such every bit seamless zoom, bokeh, together with stereo vision. The API also lets you lot telephone proper name upwardly a logical or fused photographic boob tube camera flow that automatically switches betwixt 2 or to a greater extent than cameras. We're looking frontward to seeing your novel together with exciting creations every bit Android P devices supporting multiple cameras accomplish the marketplace inward the twelvemonth ahead.

Other improvements inward photographic boob tube camera include novel Session parameters that assist to cut back delays during initial capture, together with Surface sharing that lets photographic boob tube camera clients lead hold diverse use-cases without the demand to halt together with start photographic boob tube camera streaming. We've also added APIs for display-based flash support together with access to OIS timestamps for app-level picture stabilization together with special effects.

ImageDecoder for bitmaps together with drawables

Android P gives you lot an easier agency to decode images to bitmaps or drawables -- ImageDecoder, which deprecates BitmapFactory. ImageDecoder lets you lot create a bitmap or drawable from a byte buffer, file, or URI. It offers several advantages over BitmapFactory, including back upwardly for exact scaling, single-step decoding to hardware memory, back upwardly for post-processing inward decode, together with decoding of animated images.

You tin move decode together with scale to an exact size merely past times calling setResize() alongside the target dimensions. You tin move also telephone proper name upwardly getSampledSize() to acquire the picture dimensions at a specific sample rate, together with thus scale to those dimensions. If you lot desire post-process an picture -- such every bit applying rounded corners for circle masks or to a greater extent than complicated effects -- you lot tin move transcend ImageDecoder whatever android.graphics.PostProcessor. You tin move also create Drawables directly, alongside ImageDecoder.decodeDrawable(). If the encoded picture is an animated GIF or WebP, the Drawable volition live an instance of the novel AnimatedImageDrawable.

HDR VP9 Video, HEIF picture compression, together with Media APIs

Android P adds built-in back upwardly for HDR VP9 Profile 2, thus you lot tin move at nowadays deliver HDR-enabled movies to your users from YouTube, Play Movies, together with other sources on HDR-capable devices.

We're excited to add together HEIF (heic) picture encoding to the platform. HEIF is a pop format for photos that improves compression to salve on storage together with network data. With platform back upwardly on Android P devices, it's slow to ship together with utilize HEIF images from your backend server. Once you've made certain that your app is compatible alongside this information format for sharing together with display, give HEIF a seek every bit an picture storage format inward your app. You tin move do a jpeg-to-heic conversion using ImageDecoder or BitmapFactory to obtain a bitmap from jpeg, together with you lot tin move role HeifWriter inward the novel Support Library alpha to write HEIF withal images from YUV byte buffer, Surface, or Bitmap.

We're also inward the physical care for of enhancing together with refactoring the media APIs to brand them easier to develop together with integrate alongside -- sentry for details coming afterwards this year.

Data damage sensitivity inward JobScheduler

JobScheduler is Android's key service to assist you lot acquire by scheduled tasks or operate across Doze, App Standby, together with Background Limits changes. In Android P, JobScheduler handles network-related jobs amend for the user, coordinating alongside network condition signals provided separately past times carriers.

Jobs tin move at nowadays declare their estimated information size, betoken prefetching, together with specify detailed network requirements—carriers tin move written report networks every bit existence congested or unmetered. JobScheduler together with thus manages operate according to the network status. For example, when a network is congested, JobScheduler powerfulness defer large network requests. When unmetered, it tin move run prefetch jobs to improve the user experience, such every bit past times prefetching headlines.

When you lot are adding jobs, seek using setEstimatedNetworkBytes(), setIsPrefetch() together with setRequiredNetwork() to allow JobScheduler lead hold the operate properly. When your project executes, live certain to role the Network object returned past times JobParameters.getNetwork(), otherwise you'll implicitly role the device's default network which may non encounter your requirements, causing unintended information usage.

Neural Networks API 1.1

We introduced the Neural Networks API inward Android 8.1 to accelerate on-device machine learning on Android. In Android P we're expanding together with improving this API, adding back upwardly for ix novel ops -- Pad, BatchToSpaceND, SpaceToBatchND, Transpose, Strided Slice, Mean, Div, Sub, together with Squeeze. If you lot receive got a Pixel 2 device, the DP1 create at nowadays includes an Qualcomm Hexagon HVX driver alongside acceleration for quantized models.

Autofill improvements

In Android P we're continuing to improve the Autofill Framework based on feedback from users together with developers. Along alongside key bugfixes, this unloose includes novel APIs that allow password managers to improve the Autofill user experience, such every bit amend dataset filtering, input sanitization, together with compatibility mode. Compatibility fashion inward particular has a high impact on terminate users because it lets password managers accept the accessibility-based approach inward apps that don't yet receive got total Autofill support, but without impacts on surgical physical care for or security. See all the details on what's novel here.

Open Mobile API for NFC payments together with secure transactions

Android P adds an implementation of the GlobalPlatform Open Mobile API to Android. On supported devices, apps tin move role the OMAPI API to access secure elements (SE) to enable smart-card payments together with other secure services. Influenza A virus subtype H5N1 hardware abstraction layer (HAL) provides the underlying API for enumerating a diversity of Secure Elements (eSE, UICC, together with others) available.

Strengthening Android's foundations

In Android P we're continuing our long-term investment to brand Android the best platform for developers.

Security for apps

In Android P we're moving to a to a greater extent than consistent UI for fingerprint authentication across apps together with devices. Android at nowadays provides a measure organisation dialog to prompt the user to touching the fingerprint sensor, managing text together with placement every bit appropriate for the device. Apps tin move trigger the organisation fingerprint dialog using a novel FingerprintDialog API. We recommend switching to the novel organisation dialog every bit presently every bit possible.

As portion of a larger endeavor to motility all network traffic away from cleartext (unencrypted HTTP) to TLS, we're also changing the defaults for Network Security Configuration to block all cleartext traffic. You'll at nowadays demand to brand connections over TLS, unless you lot explicitly opt-in to cleartext for specific domains.

Privacy for users

To amend ensure privacy, Android P restricts access to mic, camera, together with all SensorManager sensors from apps that are idle. While your app's UID is idle, the mic reports empty good together with sensors halt reporting events. Cameras used past times your app are disconnected together with volition generate an mistake if the app tries to role them. In most cases, these restrictions should non innovate novel issues for existing apps, but nosotros recommend removing these requests from your apps.

We volition also enable encryption of Android backups alongside a client-side secret. This characteristic is withal inward active evolution together with volition live launched inward a futurity Android P preview release.

Longer term we're working to convey back upwardly for per-network randomization of associated MAC addresses to the platform. On supported devices running Android P, you lot tin move enable this experimentally for testing every bit a novel developer option.

Android P also gives the user command over access to the platform's build.serial identifier past times putting it behind the READ_PHONE_STATE permission. Direct access to this identifier has been deprecated since Android 8.0. In guild to access the build.serial identifier, you lot should role the Build.getSerial() method.

ART performance

We're working to convey surgical physical care for together with efficiency improvements to all apps through the ART runtime. We've expanded ART's role of execution profiles to optimize apps together with cut back in-memory footprint of compiled app code. ART at nowadays uses profile information for on-device rewriting of DEX files, alongside reductions upwardly to 11% across a gain of pop apps. We human face these to correlate closely alongside reductions inward organisation DEX retention usage together with faster startup times for your apps.

Optimized Kotlin

Kotlin is a first-class linguistic communication on Android, together with if you lot haven't tried it yet, you lot should! We've made an enduring commitment to Kotlin inward Android together with proceed to expand back upwardly including optimizing the surgical physical care for of Kotlin code. In P you'll see the offset results of this operate -- we've improved several compiler optimizations, specially those that target loops, to extract amend performance. We're also continuing to operate inward partnership alongside JetBrains to optimize Kotlin's generated code. You tin move acquire all of the latest Kotlin surgical physical care for improvements merely past times keeping Android Studio's Kotlin plugin up-to-date.

Power efficiency

In Android P nosotros proceed to refine Doze, App Standby, together with Background Limits to farther improve battery life; delight live certain to seek your apps alongside these together with ship feedback.

Targeting modern Android

Android P is shaped past times our longer-term initiatives to modernize the foundations of Android together with the apps that run on it. As nosotros announced recently, Google Play volition require all app updates to target Android Oreo (targetSdkVersion 26 or higher) past times Nov 2018, alongside back upwardly for 64-bit hardware on the horizon for 2019.

In line alongside these changes, Android P volition warn users alongside a dialog when they install an app that targets a platform before than Android 4.2 (targetSdkVersion less than 17), together with futurity platform versions volition proceed to growth that lower bound. We're encouraging every Android developer to start planning the migration to target API 26 now, together with to start the migration operate every bit presently every bit possible. Here's a checklist of resources for assist together with back upwardly -- we're looking frontward to seeing your apps getting the most from modern Android.

Improving app compatibility through world APIs

Influenza A virus subtype H5N1 key number for users together with developers is app compatibility -- making certain that apps are ready for novel platform versions every bit they arrive, without gamble of crashes for users together with emergency rollouts for developers. Apps that role Android's world APIs from the SDK or NDK are inward a skillful seat to live compatible, but apps that role mortal Android interfaces together with libraries are not.

So alongside Android P we're starting a gradual process to bound access to selected non-SDK interfaces, asking developers -- including app teams within Google -- to role Earth equivalents instead. In cases where at that topographic point is no world equivalent for your use-case, delight let us know -- nosotros desire to brand certain that this physical care for is every bit smoothen every bit possible for developers, thus we'll role your feedback to ensure the initial rollout alone affects APIs where developers tin move easily migrate to world alternatives. More almost the restrictions is here.

Get started inward a few unproblematic steps

First, make your app compatible to give your users a seamless transition to Android P. Just download a device organisation image or emulator organisation image, install your electrical flow app, together with seek -- the app should run together with human face great, together with lead hold behavior changes properly. After you've made whatever necessary updates, nosotros recommend publishing to Google Play correct away without changing the app's platform targeting.

Remember, you lot don't demand a supported Pixel device to seek or develop on Android P. For most uses nosotros highly recommend setting upwardly an Android Virtual Device on the Android Emulator as a seek surroundings instead. If you lot haven't tried the emulator recently, you'll abide by that it's incredibly fast , boots inward nether vi seconds, convenient to use, together with you lot tin move fifty-fifty model next-gen screens -- such every bit long screens together with screens alongside photographic boob tube camera cutout.

Next, change your app's targeting to "P" together with run it alongside the total Android P experience. Set your app's targetSdkVersion to 'P' together with compileSdkVersion to android-P, build, together with test. Make certain to read the deportment changes for apps targeting P to abide by areas you lot volition desire to seek together with powerfulness demand to adjust.

When you're ready, dive into Android P together with acquire almost the many new features together with APIs you lot tin move accept wages of inward your app. To brand it easier to explore the novel APIs, accept a human face at the API diff report, along alongside the Android P API reference. Visit the P Developer Preview site for details on the preview timeline together with support resources. Also banking enterprise gibe out this video highlighting what's novel inward Android P for developers.

To acquire started edifice alongside Android P, download the P Developer Preview SDK together with tools into Android Studio 3.1 or role the latest Android Studio 3.2 canary version. We're also releasing an alpha version of the 28.0.0 back upwardly library for you lot to try.

What's ahead?

The Android P Developer Preview includes an updated SDK alongside organisation images for testing on the official Android Emulator together with on Pixel, Pixel XL Pixel 2, together with Pixel 2 XL devices.

We conception to update the preview organisation images together with SDK regularly throughout the preview. This initial unloose is for developers alone together with non intended for daily or consumer use, thus we're making it available past times manual download together with flash only. Downloads together with instructions are here.

As nosotros acquire closer to a lastly product, we'll live inviting consumers to seek it out every bit well, together with we'll opened upwardly up enrollments through Android Beta at that time. Stay tuned for details, but for at nowadays delight banknote that Android Beta is non currently available for Android P.

As always, your feedback is critical, thus delight let us know what you lot think — the sooner nosotros take away heed from you, the to a greater extent than of your feedback nosotros tin move integrate. When you lot abide by issues, delight report them here. We receive got dissever hotlists for filing platform issues, app compatibility issues, together with third-party SDK issues.

Related Post

Previewing Android P
4/ 5
Oleh