4
头图

Author/ Dave Burke, VP of Engineering

Today at the Google I/O conference, we released the first Beta version of Android 12. Android 12 is one of our most ambitious versions ever. We are committed to creating a new user interface that can adapt to your needs, improve performance, and put privacy and security at the core. For developers, we provide you with more tools for you to build pleasant experiences on mobile phones, laptops, tablets, wearable devices, TVs, and cars.

There are many things to explore in Beta 1. The first is the most important UI update to the Android system. This interface is created with a design language Material You In addition, we also provide some new privacy features for everyone to experience, such as approximate location, and a new standard called Performance Class, which allows applications and users to identify high-performance devices.

Today you can start to experience the Android 12 Beta version In addition, thanks to the efforts of our equipment manufacturer partners, you can now experience the Beta version on more devices, including those from ASUS, OnePlus, OPPO, Realme, Sharp, TCL, Transsion, Vivo, Xiaomi And some of ZTE's equipment, more equipment is also joining the ranks. Click here for more details.

Please continue reading this article for more release highlights. For more information about Android 12 and how to start development, please visit Android 12 developer site .

Android's new UI

As we consumer-oriented blog , Android 12 brings the biggest design change in Android history. We rethinked the entire experience, including colors, shapes, lighting, and motion effects, making Android 12 more expressive, more vivid, and more personalized. This work is done under the in-depth cooperation of our software, hardware, and Material Design teams. We are unifying the software and hardware ecosystem under the same design language, named Material You .

We have extended the new design language to the entire platform and UI components, so your app will automatically get these upgrades.

redesigned widget -With the update of the design in Android 12, the application widget has also been brand new, more practical, more beautiful, and easier to discover. We have added new interactive controls , such as check boxes, switches and radio buttons, and let configure widgets more easily. The Android 12 widget is very beautiful with our system UI and themes. The rounded corners and filling can automatically adapt to each launcher and home screen. Responsive layout allows you to adapt widgets to mobile phones, tablets, foldable devices and other screens. We also added dynamic color API so that your widget can use system colors to create a personalized and consistent appearance. We also made widgets easier to discover through improved widget selectors and integration with Assistant. You can view the sample code here and get started. Please visit official document for details.

Over-scroll stretch -We also added a new system-level over-scroll "stretch" effect to let users know that they have scrolled to the end of the content in the user interface. The stretch effect provides a natural vertical and horizontal scroll stop indication, which is common to all applications and is enabled by default in the entire platform and the scroll container of AndroidX. The new over-rolling stretch effect replaces the glow effect in the previous version. Be sure to test the new scrolling behavior in your apps and content, or you can choose not to enable this feature. Please visit official document for details.

Smoother audio transition -UI not only covers visual effects, we also improved the way we handle audio focus. When an application loses audio focus, its audio will automatically fade out, thereby providing a smoother transition between applications playing audio and preventing their sounds from overlapping each other. This is especially important in a foldable and multi-screen Android environment. Please visit official document for details.

performance

In Android 12, we have made significant and in-depth resource investment in performance: from improving basic performance to make the system and applications faster and smoother, to setting new standards for high-performance devices to help developers in these devices To provide a richer experience.

Faster and more efficient system performance -We have reduced the CPU time required for core system services by 22%, so the device will be faster and more sensitive. We have also reduced the use of large cores by the system server by 15%, thereby improving the power efficiency of Android, allowing the device to run longer before it needs to be charged.

We have improved application switching and startup time by reducing lock contention and latency changes. We also optimized I/O to speed up application loading. In PackageManager, read-only snapshots reduce lock contention by 92%. In Binder, the lightweight cache fundamentally improves the latency of target calls, up to 47 times. In terms of I/O, we accelerated the dex/odex/vdex file to improve the loading time of the application, which is especially obvious on low-memory phones. Our restriction on notification trampoline also helps to reduce the latency of apps launched from notifications. For example, after not using the notification jump, the launch speed of the Google Photos application increased by 34%.

In order to improve database query performance, we optimized CursorWindow by inlining the results in the Binder transaction. For small windows, the speed of CursorWindow is increased by 36%, and for windows with more than 1,000 rows, the improvement can be up to 49 times.

Performance level -Starting from Android 12, we and our ecosystem partners have introduced a common standard for high-performance Android devices.

This standard is called Performance Class, which defines a set of performance beyond the basic requirements of Android. Devices that meet the performance level requirements can support more demanding use cases and provide higher quality content. Developers can in check performance levels runtime , then reliably deliver an enhanced experience to take full advantage of the performance of the device.

At present, we focus on performance level indicators on media use cases, covering indicators including camera startup delay, available codecs and encoding quality, minimum memory size, screen resolution, and read/write performance. Please visit official document for details.

Protect privacy from the design source

Privacy is the core of all our work. In Android 12, we will continue to provide you with more transparency and control, while ensuring device and data security. Today we also released some privacy features that will appear in Beta 2, including Privacy Dashboard, background information that allows apps to share more data usage, microphone and camera indicators, microphone and camera switches, And clipboard notifications. Please continue to pay attention to subsequent updates of these features. The following is the new content added in Beta 1.

App dormancy -Last year we released automatic permission reset function, in the past two weeks, Android reset more than 8.5 million unused app permissions. Those applications that have been forgotten will no longer be able to access user data. In Android 12, based on the automatic reset of permissions, we intelligently sleep applications that have not been used for a long time to optimize device storage, performance, and security. Hibernation will not only revoke the permissions previously granted by the user, but also forcibly stop the application and reclaim memory, storage, and other temporary resources. The system also prevents dormant apps from running jobs in the background or receiving push notifications to help users stay safe. Hibernation should be transparent to most apps, but if needed, you can direct users to turn off your app’s hibernation feature in the settings. Please visit official document for details.

Nearby device permissions -Previously, Bluetooth scanning required apps to have location permissions, which is a challenge for apps that need to pair with nearby devices but don’t actually need the location of the device. The app can now scan for nearby devices without requiring location permission. Applications that upgrade the Target SDK level to Android 12 can use the new BLUETOOTH_SCAN permission and set usesPermissionFlags="neverForLocation" attribute to scan. After pairing with the device, you can use BLUETOOTH_CONNECT permission to interact with it. These permissions are designed to promote privacy-friendly application design while lowering the barriers to application usage. Please visit official document for details.

approximate location - recent version of the update, we offer a better way for everyone to manage access to location , such as providing separate permissions for access to foreground and background, and "only this time" option. Now, for apps targeting Android 12, we bring more control through the new "approximate location" option. When the app requests precise location data, the user can now choose to grant precise or approximate locations. The user can modify the position accuracy of the application at any time through "Settings". If your application requests precise location data ( ACCESS_FINE_LOCATION ), please consider the changes brought about this time to ensure that your application can run normally when only approximate locations are obtained. For almost all common location use cases, we recommend only asking for approximate locations ( ACCESS_COARSE_LOCATION ). Please visit official document for details.

Application compatibility

If you haven't tested the compatibility of your app with Android 12, now is the time to test it! As Android 12 enters the Beta version, we have opened up early experience users and developers on Pixel and other devices This means that in the coming weeks you will see more users experience your app on Android 12 and submit issues they find.

To perform compatibility testing, please install your official version of the application through Google Play or other sources on a device or emulator running Android 12 Beta, and test all processes of the application. Please use the behavior change to determine the test focus. Please post an updated version as soon as possible after solving all the problems found.

With the release of the Beta version, we are getting closer and closer to the platform stability milestone in August 2021. At that time, the application-oriented system behavior, SDK/NDK API and non-SDK list will all be finalized. You will be able to complete the final compatibility test and release a fully compatible application, SDK or development library. See the release timetable .

Start experiencing Android 12 now

Whether you want to experience functional Android 12, and test applications or submit feedback , we can start from the Beta version. Just with a supported Pixel device to participate in the test , and you can get the update over the air (OTA). If you have installed the previous preview version, you will automatically get the Beta version update. To start development, please set up your SDK.

You can also experience Android 12 Beta on devices of top device manufacturer partners participating in the Android 12 Developer Preview Program. Please visit developer.android.google.cn/about/versions/12/devices for a complete list of partners and links to their websites for detailed information on the devices they support. Each partner will provide registration and support functions, and provide you with beta updates directly.

For more extensive testing on more devices, please install and experience Android 12 Beta Android GSI image If you don't have a device, you can also test on the Android emulator. Just download the latest emulator system image through the SDK manager of Android Studio.

Please visit Android 12 developer site details on obtaining the Beta version.

Your product feedback and questions are very important to us, welcome click here to submit feedback to us. Your question may appear in the next FAQ and be answered. thank you for your support!


Android开发者
404 声望2k 粉丝

Android 最新开发技术更新,包括 Kotlin、Android Studio、Jetpack 和 Android 最新系统技术特性分享。更多内容,请关注 官方 Android 开发者文档。