头图

Author/ Dave Burke, VP of Engineering

On October 4th, we have pushed the source code to the Android open source project (AOSP), and officially released the latest version of Android. Android 12 will be pushed to Pixel devices in the next few weeks, and will cover Samsung Galaxy, OnePlus, OPPO, realme, TECNO, Vivo and Xiaomi devices later this year.

Thank you again for the feedback you shared during the Android 12 Beta! More than 225,000 people have tested the early version of Android 12 on the devices of Pixel and partner manufacturers, and submitted nearly 50,000 problem reports to us to help improve the quality of the version. We are also very grateful to everyone for their valuable ideas in many articles, discussions, surveys and interviews, as well as the work done to ensure that their applications receive timely compatibility updates. Your support and contributions make Android a great system platform for everyone.

We will also share more Android 12 details Android Dev Summit held from October 27th to 28th this year. About this summit, we have brought more information including technical presentations, including an overview of Android, please continue reading this article or Click here learn more.

What does Android 12 bring to developers?

Here are some new features of Android 12 that developers should not miss. Be sure to go to the Android 12 developer site see the details of all the new features.

Android's new UI

Material You -Android 12 brings a new design language called Material You to help you build more personalized and beautiful applications. If you want to bring all the latest Material Design 3 new features into your application, please try Material Design component , and pay attention to the upcoming Jetpack Compose support.

Redesigned widgets (widgets) -We have redesigned application widgets to make them more practical, beautiful, and easier to find. You can experience new interactive controls, responsive layouts for any device, and dynamic colors to create an appearance that is full of personality while still having a high degree of consistency. Please visit official document for detailed information.

notification interface update -We also revised the notification design to make it more modern and practical. Android 12 will also use standard elements to beautify custom notifications and make their look and feel consistent with other notifications. Please visit official document for details.

Over-scrolling and stretching effect -In order to make the application content scroll more smoothly, Android 12 adds a new over-scrolling "stretching" effect to all scrolling containers. This built-in scroll stop effect covers the entire system and all applications. Please visit official document for details.

application splash screen -Android 12 also brings a new splash screen for all applications. The application can also customize the splash screen in a variety of ways to show its unique brand personality. Please visit official document for details.

performance

Faster and more efficient system performance -We reduced the CPU time required for core system services by 22% and reduced the use of large cores by 15%. We also improved the startup time of the application, and optimized I/O to speed up the loading speed of the application; for database queries, when using CursorWindow to process large amounts of data, we improved its performance by as much as 49 times.

foreground service optimization -In order to provide users with a better experience, Android 12 prohibits apps from starting foreground services in the background. The application can use the newly introduced expedited job ) (expedited job) in JobScheduler to replace the previous practice. Please visit official document for details.

More sensitive notifications -Android 12's restriction on notification trampoline (using broadcast receivers or services to indirectly start the target activity) helps reduce the delay in launching applications from notifications. For example, the Google Photos app started 34% faster after not using the notification trampoline. Please visit official document for details.

Performance class -Performance class defines a set of device features that together support more demanding use cases and higher quality content running on Android 12 devices. The application can check the performance level of the device at runtime and make full use of the performance of the device. Please visit official document for details.

Faster machine learning -Android 12 can help you make the most of ML accelerators and always get the best performance through the Neural Networks API. The ML accelerator driver can now also be updated independently of the platform version through the Google Play service, so you can use the latest driver on any compatible device.

Privacy

Privacy Information Center -This new information center in Settings allows users to better understand when applications access microphone, camera, and location data. Please visit official document for details.

Approximate location -Users have more control over location data. Even if your app requests the exact location, they can only authorize access to the approximate location. Please visit official document for details.

Microphone and camera indicator -The indicator in the status bar lets users know when the app is using the device camera or microphone. Please visit official document for details.

Microphone and camera switch -On supported devices, a new switch in the Quick Settings allows users to easily immediately block all applications from accessing the microphone and camera. Please visit official document for details.

Nearby device permissions -Your app can use the new permissions to scan for nearby devices and pair with them without needing to obtain location permissions. Please visit official document for details.

better user experience tool

Rich media content insertion -Added a unified API so that your user interface can receive rich media content from any source: including clipboard, keyboard, drag and drop, etc. To ensure forward compatibility, we also added this unified API to AndroidX. Please visit official document for details.

supports rounded-corner screens -Many modern devices have rounded corners on their screens. In order to provide a good user experience on these devices, you can use the new API to query rounded corner details, and then manage UI elements as needed. Please visit official document for details.

AVIF image support -Android 12 adds platform support for AV1 image file format (AVIF). AVIF utilizes the intra-encoded content of video compression. Compared with the old image format (such as JPEG), the image quality can be greatly improved under the same file size.

compatible media transcoding -For video content, the HEVC format has a significant improvement in quality and compression. We recommend that all applications support this format. Applications that cannot support HEVC can use the compatible media transcoding function. The application only needs to request files in AVC format, and the system will transcode them. Please visit official document for details.

easy-to-use special effects such as blur and color filters -The new API allows you to more easily apply common graphic effects to views and rendering structures. You can use RenderEffect apply blur, color filters and other effects to RenderNode or View. You can also use the new Window.setBackgroundBlurRadius() ) API to create a matte glass effect for the window background, or use blurBehindRadius to blur everything behind the window.

Enhanced Tactile Experience -Android 12 provides more tools to create rich tactile feedback for UI events, as well as create a more immersive and enjoyable experience for games, and create tactile effects that help increase productivity. Please visit official document for details.

new camera effects and sensor functions -new device manufacturer extension allows applications to use custom camera effects created by device manufacturers, such as bokeh, HDR, night mode, etc. You can also use the new API to take full advantage of ultra-high resolution cameras equipped with Quad/Nona (Quad/Nona) Bayer mode. Please visit official document for more information.

better debug native code crashes -Android 12 provides more operable diagnostic information, allowing you to debug NDK-related crashes more easily. Applications can now access detailed crash dump files (called tombstone ) App Exit Reasons API

Android 12 games support -Through the game mode (Game Mode) API, you can react when the player chooses different performance configurations for the game: for example, to save battery consumption during a long commute, or through performance mode Higher frame rate. (play as you download) function will allow the game to download game resources from the background during the installation process, allowing players to enter the game faster.

your app for Android 12

With the official release of Android 12, we require all Android developers complete compatibility testing and release update as soon as possible so that users can transition to Android 12 smoothly.

To test the compatibility of the application, just device running Android 12 on , and test all the processes of the application to find out the problems exposed on the function or UI. Please use Android 12 behavior change list (for all applications) to find out the changes that may affect the application.

Here are some changes to be aware of:

  • Privacy Information Center -Use this new information center in Settings to view the application's access to microphones, location information, and other sensitive data. You may also consider providing users with detailed information about the reason for the visit. Please visit official document for details.
  • Microphone and camera indicators -When the app is using the camera or microphone, Android 12 will display indicators in the status bar. Please make sure that the logo does not affect the user interface of the application. Please visit official document for details.
  • Microphone and camera switch -Use the new switch in Quick Settings to disable app access to microphone and camera. Please make sure your app can handle this change correctly. Please visit official document for details.
  • Clipboard access notification -When the application reads data from the clipboard, please pay attention to the message box message that appears. Please avoid accidental access. Please visit official document for details.
  • Over-scrolling and stretching effect -Please experience the new "stretching" over-scrolling effect through your scrolling content, and make sure that the content is displayed as expected. Please visit official document for details.
  • Application splash screen -Launch your application through various processes to test the new startup animation. If necessary, you can customize it. Please visit official document for details.
  • Keygen changes -We have removed some obsolete BouncyCastle encryption algorithms and implemented it using Conscrypt instead. If your application uses a 512-bit AES key, you need to change it to the standard length supported by Conscrypt. Please visit official document for details.

Don't forget to test the compatibility of the development library and SDK in the application. If you find a problem with the SDK, please try to update the SDK to the latest version, or ask its developer for help.
Once you have released the compatible version of the current application, you can start to upgrade the targetSdkVersion application. Please refer to the behavior change list (for Android 12-oriented applications) and use the compatibility framework tool to quickly detect the problem.

gather at Android Dev Summit 2021 to see Android 12 and many more!

\#AndroidDevSummit is back! October 27-28, , and learn about the latest developments in Android including Android 12. This year’s theme is outstanding applications and cross-device . You will also learn about development tools, APIs and technologies that help improve work efficiency, so as to create better applications that run on billions of devices, including Tablet computers, foldable devices, wearable devices, etc.

We also brought more news about this summit, including an overview of more than 30 Android technical lectures. You can check and plan which sessions you should pay attention to official website In the next few weeks, we will also invite you to submit \#AskAndroid questions, and our team members will answer them at the summit.

The summit will open at 10 am on October 27th, U.S. Pacific time (1 am on October 28th, Beijing time). The first show is The Android Show. This is a 50-minute technical keynote speech. Hear all the latest news and developments related to Android developers. Do not forget to registered and get updates.

Welcome to click here to submit feedback to us, or share your favorite content or problems found. Your feedback is very important to us, thank you for your support!


Android开发者
404 声望2k 粉丝

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