Affiliate links on Android Authority may earn us a commission. Learn more.
Android 12 developer preview for developers - Updated for Preview 3
Wow, is it that time of year already? It seems no time at all since Android 11 landed and yet here we are with what’s now the third developer preview of Android 12! As always, we’ll be sharing all the changes devs need to know about in this post. That includes the recent updates up to Developer Preview 3 (the latest at the time of writing).
Highlights include compatible media transposing and new copy-paste features. Of course, Google has lots more changes in store for us with future releases. But this is an early sign of things to come and there’s already some interesting stuff to keep us busy!
For the full scoop, check out the post at Android Developers Blog. Here, I’ll attempt to share the cliff-notes version, and draw your attention to anything that needs your urgent attention.
We’ll be updating this page as future previews roll out, so you’ll be able to find everything you need in this one spot as you prep your app for the future of the platform.
Google is always keen to put emphasis on security and Android 12 is no different. The focus is on increasing use control and transparency. These changes have the potential to impact the way apps behave, so this is important for developers to keep in mind.
Cookie changes in WebView: Google recently made changes to Chrome that change the way cookies are handled. These changes will now be reflected in the Android WebView. The SameSite attribute will dictate whether cookie requests are limited to just that site. Cookies without that attribute will be treated as SameSite=Lax.
Restricted Netlink Mac: Netlink MAC is restricted in Android 12 regardless of targetSDK.
Safer exporting of components: The default handling of andoird:exported attribute has been altered to be more specific. Now components that declare intent filters need to explicitly declare android:exported as well.
PendingIntents to change: PendingIntents will be more secure in Android 12 and must declare a mutability flag.
App overlay controls: App developers can now decide whether or not overlays can be shown over their content with Window#setHideOverlayWindows().
Extended security for lockscreen notification actions: Developers can now configure notification actions so that they will always trigger an authentication challenge when displayed on the lockscreen.
Access to app digests: A new API will let you query Android for the checksum of an installed app.
HEVC transcoding: HEVC hardware encoders are increasingly common and provide improved quality and compression versus older codecs. While most apps should support HEVC, Android 12 now offers built in transcoding to AVC format. A one minute video filmed at 1080p, 30fps HEVC will take roughly 9 seconds to transcode on a Pixel 4. More here.
This should result in a more seamless experience for users and less work for developers.
Platform support for AVIF image format: Likewise, AVIF image support can offer better images and compression for still pictures. Android 12 brings native support for the AV1 format.
Audio-coupled haptic feedback: Android 12 brings audio-coupled haptic feedback. Strength and frequency of vibration are dictated by audio. This should offer instant improvements to the user experience in games but has other applications, too. An example given by Google is to identify callers from any app based on custom ringtones. Use HapticGenerator#isAvailable() to check whether the device supports haptic feedback.
Update 3 has brought new additions. Expressive effects like “low tick” will take advantage of the latest actuators and game developers can access multiple, different actuators simultaneously.
Easier blurs, color filters, and other effects: Android 12 should help developers make prettier apps. RenderEffect will apply blurs, color filters. and more with ease to Views.
Support for quad bayer cameras: Android 12 is adding new platform APIs so that devs can access powerful Quad/Nona Bayer cameras.
- Standardization for the set of keys controlling the range of video Quantization Parameters. Available in the MediaFormat API and NDK Media library.
- Camera2 extensions. Custom camera effects will now be accessible directly in platform, as well as through the CameraX library.
User experience changes
Improved app launch experience: Android 12 will bring more “consistent and delightful” app launch experiences. That means a new animation that will be customizable for devs. Read more here.
Foreground service optimizations: Foreground services are useful for running a number of tasks. Android 12 will block background services from moving into the foreground unless they target the new platform. The new expedited job in JobScheduler will benefit from elevated process priority and network access. It will run immediately even in Battery Saver and Doze modes.
Rich content from clipboard: A new unified API makes it simpler for devs to accept rich content copied from the clipboard, inserted by the keyboard, or dragged from other apps. This should be an effortless way for developers to create new use-cases for their users.
Support for rounded corners: A new API will allow you to get details of rounded corners to better match content to the shape of the display.
Picture in Picture Improvements: The transition to picture-in-picture mode via a swipe-up-to-home action has been improved. Window resizing for non-video content has also been improved for apps that enable seamless resize. More information here.
Keeping companion device apps awake: If your app uses a companion device (such as a fitness tracker or camera accessories) it will now be possible to wake that app when the device is near and keep it awake.
- New permissions for exact alarms.
- New notification template for apps that handle calls.
- Improved web linking that changes the default handling of links not verified through Android App Links.
Gestures on by default: Gestures will now be enabled by default in full-screen/immersive apps such as video viewers and eReaders. However, the feature will remain off by default when gaming.
New notifications: Notifications are getting a minor visual overhaul with new transitions and animations. Devs will be able to decorate notifications with more custom content. Get more info here. Devs are also asked to ensure that not to use “trampolines” to ensure rapid launching of apps from notification taps – these will be blocked in apps targeting Android 12 but toasts will be used to make trampolines visible in all cases.
Bandwidth estimation improvements: Existing bandwidth estimation APIs are now more accurate.
Better debugging for native crashes: NDK-related crashes will be easier to deal with thanks to more actionable diagnostics.
More-flexible backup configurations: Android 12 will make it easier to et different rules for cloud backups and transfers across devices.
Standardized GPU compute: RenderScript APIs are being deprecated in favor of Vulkan and OpenGL. Existing APIs will continue to run for now.
Better machine learning: Neural Networks API should see significant performance improvements. ML accelerator drivers will also be updateable outside of platform releases, to allow for faster improvement going forward and to ensure the performance is available on all devices.
Google says it has taken effort to ensure compatibility with older apps. As such, most user-affecting changes will be on an opt-in basis. Usefully, developers testing their apps on Android 12 will also be able to test compatibility by toggling certain changes on and off.
To get started, you can either flash Android 12 to a Pixel device, or use the system image via the Android Emulator in Android Studio.
Be sure to check back here as we update this post to reflect future previews. In the meantime, let us know what you think about these changes and how they affect your own app projects in the comments below!
For more developer news, features, and tutorials from Android Authority, don’t miss signing up for the monthly newsletter below!