Android 16 Developer Preview 2: Key changes and enhancements
Dec 19, 2024
Google has released the second developer preview of Android 16, offering an advanced look at upcoming features, improvements, and changes to give developers ample time for adaptation.
This latest release is focused on enhancing app experiences, improving battery life, boosting performance, and minimising compatibility issues.
Here’s a breakdown of what to expect in Android 16 Developer Preview 2 (DP2):
Performance improvements and debugging tools
System triggered profiling: Expanding on the ProfilingManager introduced in Android 15, system-triggered profiling assists developers in capturing challenging scenarios like startups or “Application Not Responding” (ANR) issues. By utilising ProfilingManager#addProfilingTriggers(), apps can now register to receive diagnostic data about these flows.
Job introspection: Android 16 introduces the JobScheduler#getPendingJobReasons(int jobId) API, which provides insight into why a job is pending, including explicit constraints set by the developer and system-defined limitations. The new JobScheduler#getPendingJobReasonsHistory(int jobId) API further enables tracking of constraint changes over time. These tools allow developers to diagnose latency issues and boost job execution reliability.
Job execution optimisations: Android 16 adjusts job runtime quotas based on app status and job execution contexts, such as visibility to users or concurrency with foreground services. Developers are advised to use user-initiated data transfer methods for lengthy operations to navigate these new quotas effectively.
Adaptive refresh rate enhancements: Improvements to Adaptive Refresh Rate (ARR), which was introduced in Android 15, aim to optimise content display while reducing power usage. New APIs such as hasArrSupport() and getSuggestedFrameRate(int) make leveraging ARR easier for developers. Android’s RecyclerView 1.4 has also been updated to support ARR internally during smooth scrolling and flinging.
New and enhanced APIs
Richer haptics: With Android 16, developers gain deeper control over device haptics. New APIs allow the definition of amplitude and frequency curves for haptic feedback, abstracting differences between device capabilities for more dynamic experiences.
Application start insight: Building on ApplicationStartInfo introduced in Android 15, the addition of getStartComponent() in Android 16 allows developers to determine which component triggered an app’s start, paving the way for optimised launch sequences.
Health Connect updates: Developers now have access to a new datatype, ACTIVITY_INTENSITY, aligned with World Health Organization guidelines for moderate or vigorous activity. Updated APIs also support health records in FHIR format with proper user consent, allowing apps to read and write medical data.
Predictive back animations: Enhancements to predictive back gestures open more control for developers. By registering callbacks such as the new finishAndRemoveTaskCallback() and moveTaskToBackCallback(), specific app behaviours can be triggered alongside tailored animations.
Wi-Fi Ranging with enhanced security: Android 16 supports 802.11az, the Wi-Fi 6 protocol that strengthens security for proximity use cases such as unlocking devices. The protocol integrates security measures like AES-256 encryption, ensuring robust defence against attacks like man-in-the-middle threats.
Cloud search in the photo picker: The photo picker now includes APIs enabling cloud-based image search across platforms. This search feature, designed to securely grant access to specific media, is expected to roll out soon.
Android 16 deprecations and behaviour changes
Deprecating disruptive accessibility announcements: Accessibility announcements using announceForAccessibility() and TYPE_ANNOUNCEMENT AccessibilityEvents have been deprecated. Google advises developers to implement alternatives such as the setAccessibilityLiveRegion(int) for dynamic updates or the setError(CharSequence) method for error messaging.
JobInfo deprecation completed: The long-standing deprecation of JobInfo.Builder#setImportantWhileForeground(boolean) now takes full effect in Android 16. The method calls will be ignored, with JobInfo#isImportantWhileForeground() consistently returning false.
Transition towards predictability in Android updates
The preview highlights Google’s new two Android API release cadence planned for 2025:
- Major release in Q2 2025: This will introduce new APIs and planned behaviour changes affecting apps.
- Minor release in Q4 2025: This will focus on Android optimisations, bug fixes, and feature updates without behaviour-impacting changes.
To ensure continuous quality, incremental updates will be delivered in Q1 and Q3 between these releases.
Preparing your apps for Android 16
Developers are encouraged to begin compiling apps against the new SDK and testing for compatibility as early as possible. The Android 16 Preview Program is running from November 2024 to late Q1 2025, with the final release planned to follow shortly after the Platform Stability milestone in March 2025.
Google advises developers to test their apps under the compatibility framework and report any issues for resolution. As the platform stabilisation approaches, there will be several months to complete testing before the official launch.
Flashing a system image is required to install Android 16 Developer Preview 2, with over-the-air updates available to those using Developer Preview 1. Developers already enrolled in Android 15 QPR2 Beta can migrate to Android 16 DP2 and experience the changes without wiping their devices.
See also: Google urges Android developers to prep for 16 KB memory page
Looking to revamp your digital transformation strategy? Learn more about Digital Transformation Week taking place in Amsterdam, California, and London. The comprehensive event is co-located with IoT Tech Expo, AI & Big Data Expo, Cyber Security & Cloud Expo, and other leading events.
Explore other upcoming enterprise technology events and webinars powered by TechForge here.
Tags: android, android 16, api, coding, Developers, development, google, preview, programming