The Second Developer Preview of Android 16

The Second Developer Preview of Android 16



The Second Developer Preview of Android 16

Posted by Matthew McCullough – VP of Product Administration, Android Developer

The second developer preview of Android 16 is now obtainable to check together with your apps. This construct contains modifications designed to reinforce the app expertise, enhance battery life, and increase efficiency whereas minimizing incompatibilities, and your suggestions is vital in serving to us perceive the total affect of this work.

System triggered profiling

ProfilingManager was added in Android 15, giving apps the flexibility to request profiling information assortment utilizing Perfetto on public gadgets within the discipline. To assist seize difficult hint eventualities comparable to startups or ANRs, ProfilingManager now contains System Triggered Profiling. Apps can use ProfilingManager#addProfilingTriggers() to register curiosity in receiving details about these flows. Flows lined on this launch embody onFullyDrawn for exercise primarily based chilly begins, and ANRs.

val anrTrigger = ProfilingTrigger.Builder(
                ProfilingTrigger.TRIGGER_TYPE_ANR
            )
                .setRateLimitingPeriodHours(1)
                .construct()

val startupTrigger: ProfilingTrigger =  //...

mProfilingManager.addProfilingTriggers(listOf(anrTrigger, startupTrigger))

Begin part in ApplicationStartInfo

ApplicationStartInfo was added in Android 15, permitting an app to see causes for course of begin, begin kind, begin occasions, throttling, and different helpful diagnostic information. Android 16 provides getStartComponent() to differentiate what part kind triggered the beginning, which will be useful for optimizing the startup circulate of your app.

Richer Haptics

Android has uncovered restricted management over the haptic actuator since its inception.

Android 11 added help for extra advanced haptic results that extra superior actuators can help via VibrationEffect.Compositions of device-defined semantic primitives.

Android 16 provides haptic APIs that allow apps outline the amplitude and frequency curves of a haptic impact whereas abstracting away variations between gadget capabilities.

Higher job introspection

Android 16 introduces JobScheduler#getPendingJobReasons(int jobId) which might return a number of the reason why a job is pending, attributable to each express constraints set by the developer and implicit constraints set by the system.

We’re additionally introducing JobScheduler#getPendingJobReasonsHistory(int jobId), which returns an inventory of the newest constraint modifications.

The API may also help you debug why your jobs might not be executing, particularly when you’re seeing lowered success charges with sure duties or latency points with job completion as nicely. This will additionally higher assist you perceive if sure jobs should not finishing attributable to system outlined constraints versus explicitly set constraints.

Adaptive refresh price

Adaptive refresh price (ARR), launched in Android 15, permits the show refresh price on supported {hardware} to adapt to the content material body price utilizing discrete VSync steps. This reduces energy consumption whereas eliminating the necessity for probably jank-inducing mode-switching.

Android 16 DP2 introduces hasArrSupport() and getSuggestedFrameRate(int) whereas restoring getSupportedRefreshRates() to make it simpler in your apps to make the most of ARR.

RecyclerView 1.4 internally helps ARR when it’s settling from a fling or easy scroll, and we’re persevering with our work so as to add ARR help into extra Jetpack libraries. This body price article covers most of the APIs you need to use to set the body price in order that your app can instantly leverage ARR.

Job execution optimizations

Beginning in Android 16, we’re adjusting common and expedited job execution runtime quota primarily based on the next components:

    • Which app standby bucket the applying is in; energetic standby buckets will probably be given a beneficiant runtime quota.
    • Jobs began whereas the app is seen to the consumer and continues after the app turns into invisible will adhere to the job runtime quota.
    • Jobs which can be executing concurrently with a foreground service will adhere to the job runtime quota. If you must carry out a knowledge switch that will take a very long time think about using a consumer initiated information switch.

Word: To grasp find out how to additional debug and take a look at the conduct change, learn extra about JobScheduler quota optimizations.

Totally deprecating JobInfo#setImportantWhileForeground

The JobInfo.Builder#setImportantWhileForeground(boolean) methodology signifies the significance of a job whereas the scheduling app is within the foreground or when quickly exempted from background restrictions.

This methodology has been deprecated since Android 12 (API 31). Beginning in Android 16, it should now not perform successfully and calling this methodology will probably be ignored.

This elimination of performance additionally applies to JobInfo#isImportantWhileForeground(). Beginning in Android 16, if the strategy is known as, the strategy will return false.

Deprecated Disruptive Accessibility Bulletins

Android 16 DP2 deprecates accessibility bulletins, characterised by means of announceForAccessibility or the dispatch of TYPE_ANNOUNCEMENT AccessibilityEvents. They’ll create inconsistent consumer experiences for customers of TalkBack and Android’s display screen reader, and options higher serve a broader vary of consumer wants throughout a wide range of Android’s assistive applied sciences.

Examples of options:

The deprecated announceForAccessibility API contains extra element on recommended options.

Cloud search in picture picker

The picture picker offers a secure, built-in approach for customers to grant your app entry to chose pictures and movies from each native and cloud storage, as an alternative of their total media library. Utilizing a mixture of Modular System Parts via Google System Updates and Google Play providers, it is supported again to Android 4.4 (API stage 19). Integration requires just some strains of code with the related Android Jetpack library.

The developer preview contains new APIs to allow looking from the cloud media supplier for the Android picture picker. Search performance within the picture picker is coming quickly.

Ranging with enhanced safety

Android 16 provides help for sturdy security measures in WiFi location on supported gadgets with WiFi 6’s 802.11az, permitting apps to mix the upper accuracy, higher scalability, and dynamic scheduling of the protocol with safety enhancements together with AES-256-based encryption and safety towards MITM assaults. This enables it for use extra safely in proximity use circumstances, comparable to unlocking a laptop computer or a car door. 802.11az is built-in with the Wi-Fi 6 customary, leveraging its infrastructure and capabilities for wider adoption and simpler deployment.

Well being Join updates

Well being Join within the developer preview provides ACTIVITY_INTENSITY, a brand new datatype outlined in line with World Well being Group tips round reasonable and vigorous exercise. Every file requires the beginning time, the top time and whether or not the exercise depth is reasonable or vigorous.

Well being Join additionally incorporates up to date APIs supporting well being data. This enables apps to learn and write medical data in FHIR format with express consumer consent. This API is at present in an early entry program. Join if you would like to be a part of our early entry program.

Predictive again additions

Android 16 provides new APIs that can assist you allow predictive again system animations in gesture navigation such because the back-to-home animation. Registering the onBackInvokedCallback with the brand new PRIORITY_SYSTEM_NAVIGATION_OBSERVER permits your app to obtain the common onBackInvoked name every time the system handles a again navigation with out impacting the conventional again navigation circulate.

Android 16 moreover provides the finishAndRemoveTaskCallback() and moveTaskToBackCallback(). By registering these callbacks with the OnBackInvokedDispatcher, the system can set off particular behaviors and play corresponding ahead-of-time animations when the again gesture is invoked.

This preview is for the subsequent main launch of Android with a deliberate launch in Q2 of 2025 and we plan to have one other launch with new developer APIs in This autumn. The Q2 main launch would be the solely launch in 2025 to incorporate deliberate conduct modifications that might have an effect on apps. The This autumn minor launch will decide up function updates, optimizations, and bug fixes; it won’t embody any app-impacting conduct modifications.

2025 SDK release timeline showing a features only update in Q1 and Q3, a major SDK release with behavior changes, APIs, and features in Q2, and a minor SDK release with APIs and features in Q4

We’ll proceed to have quarterly Android releases. The Q1 and Q3 updates in-between the API releases will present incremental updates to assist guarantee steady high quality. We’re actively working with our gadget companions to convey the Q2 launch to as many gadgets as doable.

There’s no change to the goal API stage necessities and the related dates for apps in Google Play; our plans are for one annual requirement annually, and that will probably be tied to the most important API stage.

The best way to prepare

Along with performing compatibility testing on the subsequent main launch, just be sure you’re compiling your apps towards the brand new SDK, and use the compatibility framework to allow targetSdkVersion-gated conduct modifications as they change into obtainable for early testing.

App compatibility

The Android 16 production timeline shows the release stages, highlighting 'Beta Releases' and 'Platform Stability' in blue and green, respectively, from December to the final release.

The Android 16 Preview program runs from November 2024 till the ultimate public launch subsequent yr. At key improvement milestones, we’ll ship updates in your improvement and testing environments. Every replace contains SDK instruments, system pictures, emulators, API reference, and API diffs. We’ll spotlight vital APIs as they’re prepared to check within the preview program in blogs and on the Android 16 developer web site.

We’re focusing on Late Q1 of 2025 for our Platform Stability milestone. At this milestone, we’ll ship remaining SDK/NDK APIs and likewise remaining inner APIs and app-facing system behaviors. We’re anticipating to succeed in Platform Stability in March 2025, and from that point you’ll have a number of months earlier than the official launch to do your remaining testing. Be taught extra within the launch timeline particulars.

Get began with Android 16

You will get began at present with Developer Preview 2 by flashing a system picture and updating the instruments. In case you are at present on Developer Preview 1, you’ll robotically get an over-the-air replace to Developer Preview 2. We’re in search of your suggestions so please report points and submit function requests on the suggestions web page. The sooner we get your suggestions, the extra we are able to embody within the remaining launch.

For one of the best improvement expertise with Android 16, we advocate that you just use the newest preview of the Android Studio Ladybug function drop. When you’re arrange, listed here are a few of the issues you need to do:

    • Compile towards the brand new SDK, take a look at in CI environments, and report any points in our tracker on the suggestions web page.
    • Take a look at your present app for compatibility, be taught whether or not your app is affected by modifications in Android 16, and set up your app onto a tool or emulator working Android 16 and extensively take a look at it.

We’ll replace the preview system pictures and SDK often all through the Android 16 launch cycle. This preview launch is for builders solely and never meant for every day client use. We’re making it obtainable by handbook obtain. When you’ve manually put in a preview construct, you’ll robotically get future updates over-the-air for all later previews and Betas.

Should you’ve already put in Android 15 QPR Beta 2 and wish to flash Android 16 Developer Preview 2, you are able to do so with out first having to wipe your gadget.

As we attain our Beta releases, we’ll be inviting customers to attempt Android 16 as nicely, and we’ll open up enrollment for Android 16 within the Android Beta program at the moment.

For full data, go to the Android 16 developer web site.

Leave a Reply

Your email address will not be published. Required fields are marked *