<meta content="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjImJmFDXwpMRSRUyK3OsYHltR8btqa-mzT2Q34suhjJjOAOlKO_0DwVXzqtjCz_oRM8CD6UOFOGySl8HJTI16R7eMLEPT5-moqhGzQxtAPvnfsMpiPLLY-P5xgJ34XLSsDmj09xlsoPxt3upGcWzj4WMUa9XaeSp-nA16SxU8eQ58lONjZ9cdy13ylUAU/s1600/A16DP1-Feature%20%281%29.png" name="twitter:image"></meta>
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjImJmFDXwpMRSRUyK3OsYHltR8btqa-mzT2Q34suhjJjOAOlKO_0DwVXzqtjCz_oRM8CD6UOFOGySl8HJTI16R7eMLEPT5-moqhGzQxtAPvnfsMpiPLLY-P5xgJ34XLSsDmj09xlsoPxt3upGcWzj4WMUa9XaeSp-nA16SxU8eQ58lONjZ9cdy13ylUAU/s1600/A16DP1-Feature%20%281%29.png" style="display: none;" />
<em> Posted by Matthew McCullough – VP of Product Management, Android Developer</em>
<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9v1k9OJQJO50aFpos2ASIgjXE7nmTVN-CW65Pczg7bo1ttpaPNkO7mvQs6RBWEVwG70qgEiO0rNL5ARmP22Z42_G1KNz0kFFCs9TxrXifEuar13GP9aQ-2ql03rl99e7rPZm5sBKxo_uLL5hNP_lBPK82h2aRG7YcaN1r2QHCqnJIK-nOedMtxJnyJCY/s1600/android_16_platlogo_512px.png" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="1024" data-original-width="1024" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9v1k9OJQJO50aFpos2ASIgjXE7nmTVN-CW65Pczg7bo1ttpaPNkO7mvQs6RBWEVwG70qgEiO0rNL5ARmP22Z42_G1KNz0kFFCs9TxrXifEuar13GP9aQ-2ql03rl99e7rPZm5sBKxo_uLL5hNP_lBPK82h2aRG7YcaN1r2QHCqnJIK-nOedMtxJnyJCY/s1600/android_16_platlogo_512px.png" width="200" /></a></div>
<div style="text-align: left;"><br /></div><p>The second developer preview of Android 16 is now available to test with your apps. This build includes changes designed to enhance the app experience, improve battery life, and boost performance while minimizing incompatibilities, and your feedback is critical in helping us understand the full impact of this work.</p>
<h3>System triggered profiling</h3>
<p><span style="color: #0d904f; font-family: courier;">ProfilingManager</span> was added in Android 15, giving apps the ability to request profiling data collection using Perfetto on public devices in the field. To help capture challenging trace scenarios such as startups or ANRs, <span style="color: #0d904f; font-family: courier;">ProfilingManager</span> now includes System Triggered Profiling. Apps can use <a href="https://developer.android.com/reference/android/os/ProfilingManager#addProfilingTriggers%28java.util.List%3Candroid.os.ProfilingTrigger%3E%29" target="_blank"><span style="font-family: courier;">ProfilingManager#addProfilingTriggers()</span></a> to register interest in receiving information about these flows. Flows covered in this release include <span style="color: #0d904f; font-family: courier;">onFullyDrawn</span> for activity based cold starts, and ANRs.</p>
<div style="background: #f8f8f8; overflow:auto;width:auto;border:0;"><pre style="margin: 0; line-height: 125%"><span style="color: #008000; font-weight: bold">val</span> anrTrigger = ProfilingTrigger.Builder(
ProfilingTrigger.TRIGGER_TYPE_ANR
)
.setRateLimitingPeriodHours(<span style="color: #666666">1</span>)
.build()
<span style="color: #008000; font-weight: bold">val</span> startupTrigger: ProfilingTrigger = <span style="color: #408080; font-style: italic">//...</span>
mProfilingManager.addProfilingTriggers(listOf(anrTrigger, startupTrigger))
</pre></div>
<h3>Start component in <span style="color: #0d904f; font-family: courier;">ApplicationStartInfo</span></h3>
<p><span style="color: #0d904f; font-family: courier;">ApplicationStartInfo</span> was added in Android 15, allowing an app to see reasons for process start, start type, start times, throttling, and other useful diagnostic data. Android 16 adds <a href="https://developer.android.com/reference/android/app/ApplicationStartInfo#getStartComponent%28%29" target="_blank"><span style="font-family: courier;">getStartComponent()</span></a> to distinguish what component type triggered the start, which can be helpful for optimizing the startup flow of your app.</p>
<h3>Richer Haptics</h3>
<p>Android has exposed limited control over the haptic actuator since its inception.</p>
<p>Android 11 added support for more complex haptic effects that more advanced actuators can support through <span style="font-family: courier;"><a href="https://developer.android.com/reference/android/os/VibrationEffect.Composition" target="_blank">VibrationEffect.Compositions</a></span> of device-defined semantic primitives.</p>
<p>Android 16 adds <a href="https://developer.android.com/reference/android/os/vibrator/package-summary" target="_blank">haptic APIs</a> that let apps define the amplitude and frequency curves of a haptic effect while abstracting away differences between device capabilities.</p>
<h3>Better job introspection</h3>
<p>Android 16 introduces <a href="https://developer.android.com/reference/android/app/job/JobScheduler#getPendingJobReasons%28int%29" target="_blank"><span style="font-family: courier;">JobScheduler#getPendingJobReasons(int jobId)</span></a> which can return multiple reasons why a job is pending, due to both explicit constraints set by the developer and implicit constraints set by the system.</p>
<p>We're also introducing <a href="https://developer.android.com/reference/android/app/job/JobScheduler#getPendingJobReasonsHistory%28int%29" target="_blank"><span style="font-family: courier;">JobScheduler#getPendingJobReasonsHistory(int jobId)</span></a>, which returns a list of the most recent constraint changes.</p>
<p>The API can help you debug why your jobs may not be executing, especially if you're seeing reduced success rates with certain tasks or latency issues with job completion as well. This can also better help you understand if certain jobs are not completing due to system defined constraints versus explicitly set constraints.</p>
<h3>Adaptive refresh rate</h3>
<p>Adaptive refresh rate (ARR), introduced in Android 15, enables the display refresh rate on supported hardware to adapt to the content frame rate using discrete VSync steps. This reduces power consumption while eliminating the need for potentially jank-inducing mode-switching.</p>
<p>Android 16 DP2 introduces <a href="https://developer.android.com/reference/android/view/Display#hasArrSupport%28%29" target="_blank"><span style="font-family: courier;">hasArrSupport()</span></a> and <a href="https://developer.android.com/reference/android/view/Display#getSuggestedFrameRate%28int%29" target="_blank"><span style="font-family: courier;">getSuggestedFrameRate(int)</span></a> while restoring <a href="https://developer.android.com/reference/android/view/Display#getSupportedRefreshRates%28%29" target="_blank"><span style="font-family: courier;">getSupportedRefreshRates()</span></a> to make it easier for your apps to take advantage of ARR.</p>
<p><a href="https://developer.android.com/jetpack/androidx/releases/recyclerview#version_14_2" target="_blank">RecyclerView 1.4</a> internally supports ARR when it is <a href="https://android.googlesource.com/platform/frameworks/support/+/a1e9ab3e5fd52e885731bd762ff7dd4a64b25505" target="_blank">settling from a fling or smooth scroll</a>, and we're continuing our work to add ARR support into more Jetpack libraries. This <a href="https://developer.android.com/media/optimize/performance/frame-rate" target="_blank">frame rate article</a> covers many of the APIs you can use to set the frame rate so that your app can directly leverage ARR.</p>
<h3>Job execution optimizations</h3>
<p>Starting in Android 16, we're adjusting regular and expedited job execution runtime quota based on the following factors:</p>
<ul><ul>
<li>Which <a href="https://developer.android.com/topic/performance/appstandby" target="_blank">app standby bucket</a> the application is in; active standby buckets will be given a generous runtime quota.</li></ul><ul>
<li>Jobs started while the app is visible to the user and continues after the app becomes invisible will adhere to the job runtime quota.</li></ul><ul>
<li>Jobs that are executing concurrently with a foreground service will adhere to the job runtime quota. If you need to perform a data transfer that may take a long time consider using a <a href="https://developer.android.com/develop/background-work/background-tasks/uidt" target="_blank">user initiated data transfer</a>.</li></ul><ul>
</ul></ul>
<blockquote><b>Note:</b> To understand how to further debug and test the behavior change, read more about <a href="https://developer.android.com/about/versions/16/behavior-changes-all#job-quota-opt" target="_blank"><span style="font-family: courier;">JobScheduler</span> quota optimizations</a>.</blockquote>
<h4><span style="font-size: large;">Fully deprecating <span style="color: #0d904f; font-family: courier;">JobInfo#setImportantWhileForeground</span></span></h4>
<p>The <a href="https://developer.android.com/reference/android/app/job/JobInfo.Builder#setImportantWhileForeground%28boolean%29" target="_blank"><span style="font-family: courier;">JobInfo.Builder#setImportantWhileForeground(boolean)</span></a> method indicates the importance of a job while the scheduling app is in the foreground or when temporarily exempted from background restrictions.</p>
<p>This method has been deprecated since Android 12 (API 31). Starting in Android 16, it will no longer function effectively and calling this method will be ignored.</p>
<p>This removal of functionality also applies to <a href="https://developer.android.com/reference/android/app/job/JobInfo#isImportantWhileForeground%28%29" target="_blank"><span style="font-family: courier;">JobInfo#isImportantWhileForeground()</span></a>. Starting in Android 16, if the method is called, the method will return false.</p>
<h3>Deprecated Disruptive Accessibility Announcements</h3>
<p>Android 16 DP2 deprecates accessibility announcements, characterized by the use of <a href="https://developer.android.com/reference/android/view/View#announceForAccessibility%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">announceForAccessibility</span></a> or the dispatch of <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent#TYPE_ANNOUNCEMENT" target="_blank"><span style="font-family: courier;">TYPE_ANNOUNCEMENT AccessibilityEvents</span></a>. They can create inconsistent user experiences for users of TalkBack and Android's screen reader, and alternatives better serve a broader range of user needs across a variety of Android's assistive technologies.</p>
<p>Examples of alternatives:</p>
<ul><ul>
<li>For significant UI changes like window changes, use <a href="https://developer.android.com/reference/android/app/Activity#setTitle%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">Activity.setTitle(CharSequence)</span></a> and <a href="https://developer.android.com/reference/android/view/View#setAccessibilityPaneTitle%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">setAccessibilityPaneTitle(java.lang.CharSequence)</span></a>. In Compose use <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/package-summary#%28androidx.compose.ui.semantics.SemanticsPropertyReceiver%29.paneTitle%28%29" target="_blank"><span style="font-family: courier;">Modifier.semantics { paneTitle = "paneTitle" }</span></a></li></ul><ul>
<li>To inform the user of changes to critical UI, use <a href="https://developer.android.com/reference/android/view/View#setAccessibilityLiveRegion%28int%29" target="_blank"><span style="font-family: courier;">setAccessibilityLiveRegion(int)</span></a>. In Compose use <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/package-summary#%28androidx.compose.ui.semantics.SemanticsPropertyReceiver%29.liveRegion%28%29" target="_blank"><span style="font-family: courier;">Modifier.semantics { liveRegion = LiveRegionMode.[Polite|Assertive] }</span></a>. These should be used sparingly as they may generate announcements every time a View or composable is updated.</li></ul><ul>
<li>To notify users about errors, send an AccessibilityEvent of type <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent#CONTENT_CHANGE_TYPE_ERROR" target="_blank"><span style="font-family: courier;">AccessibilityEvent#CONTENT_CHANGE_TYPE_ERROR</span></a> and set <a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#setError%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">AccessibilityNodeInfo#setError(CharSequence)</span></a>, or use <a href="https://developer.android.com/reference/android/widget/TextView#setError%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">TextView#setError(CharSequence)</span></a>.</li>
</ul></ul>
<p>The deprecated <a href="https://developer.android.com/reference/android/view/View#announceForAccessibility%28java.lang.CharSequence%29" target="_blank"><span style="font-family: courier;">announceForAccessibility</span></a> API includes more detail on suggested alternatives.</p>
<h3>Cloud search in photo picker</h3>
<p>The <a href="https://developer.android.com/training/data-storage/shared/photopicker" target="_blank">photo picker</a> provides a safe, built-in way for users to grant your app access to selected images and videos from both local and cloud storage, instead of their entire media library. Using a combination of <a href="https://source.android.com/devices/architecture/modular-system" target="_blank">Modular System Components</a> through <a href="https://support.google.com/product-documentation/answer/11412553" target="_blank">Google System Updates</a> and <a href="https://developers.google.com/android/guides/overview" target="_blank">Google Play services</a>, it's supported back to <a href="https://developer.android.com/reference/android/os/Build.VERSION_CODES#KITKAT" target="_blank">Android 4.4 (API level 19)</a>. Integration requires just a few lines of code with the associated <a href="https://developer.android.com/jetpack/androidx/releases/activity" target="_blank">Android Jetpack library</a>.</p>
<p>The developer preview includes <a href="https://developer.android.com/sdk/api_diff/b-dp2-incr/changes/pkg_android.provider" target="_blank">new APIs to enable searching</a> from the cloud media provider for the Android photo picker. Search functionality in the photo picker is coming soon.</p>
<h3>Ranging with enhanced security</h3>
<p>Android 16 adds support for <a href="https://developer.android.com/reference/android/net/wifi/rtt/SecureRangingConfig" target="_blank">robust security features</a> in WiFi location on supported devices with WiFi 6's 802.11az, allowing apps to combine the higher accuracy, greater scalability, and dynamic scheduling of the protocol with security enhancements including AES-256-based encryption and protection against MITM attacks. This allows it to be used more safely in proximity use cases, such as unlocking a laptop or a vehicle door. 802.11az is integrated with the Wi-Fi 6 standard, leveraging its infrastructure and capabilities for wider adoption and easier deployment.</p>
<h3>Health Connect updates</h3>
<p>Health Connect in the developer preview adds <span style="color: #0d904f; font-family: courier;">ACTIVITY_INTENSITY</span>, a new datatype defined according to World Health Organization guidelines around moderate and vigorous activity. Each record requires the start time, the end time and whether the activity intensity is moderate or vigorous.</p>
<p>Health Connect also contains updated APIs supporting health records. This allows apps to read and write medical records in FHIR format with explicit user consent. This API is currently in an early access program. Sign up if you'd like to <a href="https://forms.gle/43HJz4Fm2UQLWy5W8" target="_blank">be part of our early access program</a>.</p>
<h3>Predictive back additions</h3>
<p>Android 16 adds new APIs to help you enable predictive back system animations in gesture navigation such as the back-to-home animation. <a href="https://developer.android.com/reference/android/window/OnBackInvokedDispatcher#registerOnBackInvokedCallback%28int,%20android.window.OnBackInvokedCallback%29" target="_blank">Registering the <span style="font-family: courier;">onBackInvokedCallback</span></a> with the new <a href="https://developer.android.com/reference/android/window/OnBackInvokedDispatcher#PRIORITY_SYSTEM_NAVIGATION_OBSERVER" target="_blank"><span style="font-family: courier;">PRIORITY_SYSTEM_NAVIGATION_OBSERVER</span></a> allows your app to receive the regular onBackInvoked call whenever the system handles a back navigation without impacting the normal back navigation flow.</p>
<p>Android 16 additionally adds the <a href="https://developer.android.com/reference/android/window/SystemOnBackInvokedCallbacks#finishAndRemoveTaskCallback%28android.app.Activity%29" target="_blank"><span style="font-family: courier;">finishAndRemoveTaskCallback()</span></a> and <a href="https://developer.android.com/reference/android/window/SystemOnBackInvokedCallbacks#moveTaskToBackCallback%28android.app.Activity%29" target="_blank"><span style="font-family: courier;">moveTaskToBackCallback()</span></a>. By registering these callbacks with the <span style="color: #0d904f; font-family: courier;">OnBackInvokedDispatcher</span>, the system can trigger specific behaviors and play corresponding ahead-of-time animations when the back gesture is invoked.</p>
<h2><span style="font-size: x-large;"><a href="https://android-developers.googleblog.com/2024/10/android-sdk-release-update.html" target="_blank">Two Android API releases in 2025</a></span></h2>
<p>This preview is for the next major release of Android with a planned launch in Q2 of 2025 and we plan to have another release with new developer APIs in Q4. The Q2 major release will be the only release in 2025 to include planned behavior changes that could affect apps. The Q4 minor release will pick up feature updates, optimizations, and bug fixes; it will not include any app-impacting behavior changes.</p>
<div style="text-align: center;"><img alt="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" border="0" height="164" id="imgCaption" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSeVe1-ddLYBDekoJnJP_c3Qq3BOxmM8IOvx6DbeaQCpau5VrnpHG8G0UFayJsIrVZehmY-Sf85Wt8iDvxJ5M8D0fGOl4M_ucFffyosC4AgRae6R6gN-mNrm3Jp8XYsJtQVHGqv84obbkuy4DvFbDgwdBXeuQ_JOveA2IWC1hbned7OkXJfWClTO2Szac/w640-h164/image2.png" width="640" /></div>
<p>We'll continue to have quarterly Android releases. The Q1 and Q3 updates in-between the API releases will provide incremental updates to help ensure continuous quality. We’re actively working with our device partners to bring the Q2 release to as many devices as possible.</p>
<p>There’s no change to the target API level requirements and the associated dates for apps in Google Play; our plans are for one annual requirement each year, and that will be tied to the major API level.</p>
<h3>How to get ready</h3>
<p>In addition to performing compatibility testing on the next major release, make sure that you're compiling your apps against the new SDK, and use the compatibility framework to enable <span style="color: #0d904f; font-family: courier;">targetSdkVersion</span>-gated behavior changes as they become available for early testing.</p>
<h3>App compatibility</h3>
<div style="text-align: center;"><img alt="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." border="0" height="164" id="imgCaption" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4OeS_v0qVUAkcecn122Ab6sPyMcFpM9xBQZziUc1ruv-udM_77bI0GDRaL0_KAIQOYwnqVSmNbLZ8tunj_dL-rOKv9Oqq-jM5rAod9-vSdbMr1fYhxRQSK5P8A2U81rEu7fF-lVERVUO5JRhx_HuWp7zZ6egxMjtGIYZRWdrAj-037DyPCiiPEpailMY/s1600/image1.png" width="640" /></div>
<p>The Android 16 Preview program runs from November 2024 until the final public release next year. At key development milestones, we'll deliver updates for your development and testing environments. Each update includes SDK tools, system images, emulators, API reference, and API diffs. We'll highlight critical APIs as they are ready to test in the preview program in blogs and on the <a href="https://developer.android.com/about/versions/16" target="_blank">Android 16 developer website</a>.</p>
<p>We’re targeting Late Q1 of 2025 for our Platform Stability milestone. At this milestone, we’ll deliver final SDK/NDK APIs and also final internal APIs and app-facing system behaviors. We’re expecting to reach Platform Stability in March 2025, and from that time you’ll have several months before the official release to do your final testing. Learn more in the <a href="https://developer.android.com/about/versions/16/overview#timeline" target="_blank">release timeline details</a>.</p>
<h2><span style="font-size: x-large;">Get started with Android 16</span></h2>
<p>You can get started today with Developer Preview 2 by flashing a system image and updating the tools. If you are currently on Developer Preview 1, you will automatically get an over-the-air update to Developer Preview 2. We're looking for your feedback so please report issues and submit feature requests on the <a href="https://developer.android.com/about/versions/16/feedback" target="_blank">feedback page</a>. The earlier we get your feedback, the more we can include in the final release.</p>
<p>For the best development experience with Android 16, we recommend that you use the latest preview of the Android Studio Ladybug feature drop. Once you’re set up, here are some of the things you should do:</p>
<ul><ul>
<li>Compile against the new SDK, test in CI environments, and report any issues in our tracker on the <a href="https://developer.android.com/about/versions/16/feedback#issue_tracker" target="_blank">feedback page</a>.</li></ul><ul>
<li>Test your current app for compatibility, learn whether your app is affected by changes in Android 16, and install your app onto a device or emulator running Android 16 and extensively test it.</li>
</ul></ul>
<p>We’ll update the <a href="https://developer.android.com/about/versions/16/download" target="_blank">preview system images</a> and SDK regularly throughout the Android 16 release cycle. This preview release is for developers only and not intended for daily consumer use. We're making it <a href="https://developer.android.com/about/versions/16/get" target="_blank">available by manual download</a>. Once you’ve manually installed a preview build, you’ll automatically get future updates over-the-air for all later previews and Betas.</p>
<p>If you've already installed Android 15 QPR Beta 2 and would like to flash Android 16 Developer Preview 2, you can do so without first having to wipe your device.</p>
<p>As we reach our Beta releases, we'll be inviting consumers to try Android 16 as well, and we'll open up enrollment for Android 16 in the Android Beta program at that time.</p>
<p>For complete information, visit the <a href="https://developer.android.com/about/versions/16" target="_blank">Android 16 developer site</a>.</p>