Android Developers Blog
The latest Android and Google Play news for app and game developers.
🔍
Platform Android Studio Google Play Jetpack Kotlin Docs News

18 5월 2021

What’s new in Android 12 Beta


Link copied to clipboard

Posted by Dave Burke, VP of Engineering

Android 12 logo

Today at Google I/O we unveiled the first Beta of Android 12, one of our most ambitious releases ever. We focused on a new UI that adapts to you, improving performance, with privacy and security at the core. For developers, we’re giving you more tools to build delightful experiences for people on phones, laptops, tablets, wearables, TVs, and cars.

There’s a lot to explore in Beta 1, starting with the most significant UI update to Android yet, created with a design language that we call Material You. There are new privacy features to try too, like approximate location, and a new standard called Performance Class that lets apps and users identify high-performing devices.

Try Android 12 Beta today on Pixel devices by enrolling here. Thanks to our device-maker partners who are working to accelerate updates, you can now get the Beta on other devices as well, including select devices from ASUS, OnePlus, Oppo, Realme, Sharp, TCL, Transsion, Vivo, Xiaomi, and ZTE, with others on the way. Visit android.com/beta to learn more.

Read on for more highlights of what’s new and visit the Android 12 developer site for details on everything in Android 12 and how to get started developing.

A new UI for Android

As we highlighted in our consumer blog post, Android 12 brings the biggest design change in Android's history. We rethought the entire experience, from the colors to the shapes, light and motion, making Android 12 more expressive, dynamic, and personal. This work is being done in deep collaboration between our software, hardware and Material Design teams, and we’re unifying our software and hardware ecosystems under a single design language called Material You.

Android 12 UI

We’ve extended the new design language across the platform and UI components, so your apps will get these upgrades automatically.

Redesigned widgets - Along with the design changes in Android 12 we’ve refreshed app widgets to make them more useful, beautiful, and discoverable. We added new interactive controls like checkboxes, switches, and radio buttons and made personalizing widgets easier. Android 12 widgets look great with our system UI and themes, with rounded corners and padding automatically adapted to every launcher and home screen. Responsive layouts let you adapt widgets to phones, tablets, foldables, and other screens. We also added dynamic color APIs so your widgets can use system colors to create a personalized but consistent look. And we’re making widgets easier to discover through an improved widget picker and an integration with the Assistant. Check out sample code and give the updated widgets a try. More here.

widgets in Android 12

Stretch overscroll - We’re also adding a new system-wide “stretch” overscroll effect to let users know they’ve scrolled past the end of the available content in your UI. The stretch effect provides a natural vertical and horizontal scroll-stop indicator that’s common across all apps, and it’s enabled by default for scrolling containers across the platform and AndroidX. The new stretch overscroll replaces the glow overscroll supported in previous versions. Make sure to test your apps and content with the new scrolling behavior, and if needed you can opt out. More here.

Smoother audio transitions - UI isn't just about the visuals. We've also improved the way that audio focus is handled. When an app loses audio focus, its audio is automatically faded out, providing a smoother transition between apps which play audio, and preventing apps from playing over each other. This is particularly relevant in foldable and multi-screen Android environments. More here.

Performance

With Android 12, we’ve made significant and deep investments in performance - from foundational performance that makes the system and apps faster and smoother, to a new standard for high-performing devices that helps developers deliver richer experiences on those devices.

Faster, more efficient system performance - We reduced the CPU time needed for core system services by 22%, so devices will be faster and more responsive. We also improved Android's power efficiency by reducing the use of big cores by the system server by 15% to help devices run longer before needing to charge.

Sampled rate , omn big core

We improved transitions and app startup times by reducing lock contention and latency variability, and we optimized I/O for faster app loading. In PackageManager, a read-only snapshot reduced lock contention by as much as 92%. In Binder, lightweight caching radically improved latencies up to 47x in targeted calls. In I/O, we accelerated dex/odex/vdex files to improve app load times, especially on low-memory phones. Our restriction on notification trampolines also helps reduce latency for apps started from a notification. For example, the Google Photos app now launches 34% faster after moving away from notification trampolines.

To improve database query performance we’ve optimized CursorWindow by inlining results in Binder transactions. For small windows, CursorWindow is 36% faster, and for windows over 1000 rows the improvements are as high as 49x.

Performance class - Starting with Android 12 and working together with our ecosystem partners, we’re introducing a common standard for high-performing Android devices.

This standard, called performance class, defines a set of capabilities that go beyond Android's baseline requirements. Devices that meet the performance class requirements can support more demanding use-cases and deliver higher quality content. Developers can check for performance class at runtime and then reliably deliver enhanced experiences that take full advantage of the device’s performance.

Initially, we’re focusing performance class capabilities on media use-cases, with requirements including camera startup latency, codec availability and encoding quality, as well as minimum memory size, screen resolution and read/write performance. More here.

Private by design

Privacy is at the heart of everything we do, and in Android 12 we’re continuing to give people more transparency and control while keeping their devices and data secure. Today we announced several new privacy features that will be coming in Beta 2 - Privacy Dashboard, microphone and camera indicators, and microphone and camera toggles. Stay tuned for more on these features. Here’s what’s new in Beta 1.

App hibernation - Last year we launched permissions auto-reset, and over the last two weeks, Android has reset permissions for over 8.5 million apps that weren’t being used - so apps that people have forgotten about can’t still access their data. In Android 12 we’re building on permissions auto-reset by intelligently hibernating apps that have gone unused for an extended period - optimizing for device storage, performance and safety. Hibernation not only revokes permissions granted previously by the user, but it also force-stops the app and reclaims memory, storage and other temporary resources. In this state the system also prevents apps from running jobs in the background or receiving push notifications, helping to keep users safe. Hibernation should be transparent for most apps, but if needed, direct users to Settings to turn off this feature for your app. More here.

Android 12 device location

Nearby device permissions - Previously, Bluetooth scanning required apps to have the location permission, which was a challenge for apps that needed to pair with nearby devices but didn’t actually need the device location. We’re now allowing apps to scan for nearby devices without needing location permission. Apps targeting Android 12 can scan using the new BLUETOOTH_SCAN permission with the usesPermissionFlags="neverForLocation" attribute. After pairing with a device, use the BLUETOOTH_CONNECT permission to interact with it. These permissions promote privacy-friendly app design while reducing friction for apps. More here.

Approximate location - Recently we’ve given people better ways to manage access to location, such as through separate permissions for foreground and background access and an “only this time” option. Now for apps targeting Android 12, we’re offering even more control with a new “approximate location” option. When apps request precise location data, users can now choose to grant either precise or approximate location. Users can also change an app’s location precision at any time from Settings. If your app requests precise location data (ACCESS_FINE_LOCATION), keep these changes in mind and make sure your app functions properly with approximate location only. For almost all general uses of location, we recommend asking for approximate location (ACCESS_COARSE_LOCATION) only. More here.

App compatibility

If you haven’t tested your app for compatibility with Android 12 yet, now is the time to do it! With Android 12 in Beta, we’re opening up access to early-adopter users as well as developers, on Pixel and other devices. This means that in the weeks ahead, expect many more users to be trying your app on Android 12 and raising any issues that they find.

To test for compatibility, install your published app from Google Play or other source on a device or emulator running Android 12 Beta and work through all of the app’s flows. Review the behavior changes to focus your testing. After you’ve resolved any issues, publish an update as soon as possible.

With Beta we’re getting closer to Platform Stability in August 2021. Starting then, app-facing system behaviors, SDK/NDK APIs, and non-SDK lists will be finalized. At that time, finish up your final compatibility testing and release a fully compatible version of your app, SDK, or library. More on the timeline for developers is here.

timeline

Get started with Android 12!

Today’s Beta release has everything you need to try the Android 12 features, test your apps, and give us feedback. Just enroll any supported Pixel device here to get the update over-the-air. If you’ve already installed a preview build, you’ll automatically get Beta updates. To get started developing, set up the SDK.

You can also get Android 12 Beta on devices from some of our top device-maker partners who are participating in the Android 12 Developer Preview program. Visit android.com/beta to see the full list of partners, with links to their sites with details on their supported devices. Each partner will handle their own enrollments and support, and provide the Beta updates to you directly.

For even broader testing on supported devices, try Android 12 Beta on Android GSI images, and if you don’t have a device you can test on the Android Emulator -- just download the latest emulator system images via the SDK Manager in Android Studio.

For complete details on how to get the Beta, visit the Android 12 developer site.