Release your eyes, put on your headphones and listen~!
Author/Stephanie Cuthbertson, Director of Product Management
Android 11coming!Today we will push the source code to the Android Open Source Project (AOSP), officially bringing you the latest version of Android.We are buildingAndroid 11Three themes were focused on:people orientedCommunication methods, allowing users to quickly access andFlexible controlAll intelligent devices, and let users have more ways to control how the data on the device is sharedPrivacy security。Please read our official blog for details.
Android Open Source Projecthttps://source.android.google.cn/
For developers, Android 11 has brought a lot of new functions, including session notification, device and media control, single permission, enhanced 5G support, IME switching effect, etc. You are welcome to try.In order to help you promote development faster, we have also added new tools, such as compatibility switch, ADB incremental installation, application exit reason API, data access audit API, Kotlin emptiness annotation, etc.All this work is to let developers love Android 11, and we are looking forward to seeing your work on it!
The official version of Android 11 will also debut on the devices around you. Pixel 2, 3, 3a, 4 and 4a series devices can be updated today.Please visit the Android 11 developer website for details.
People oriented, flexible control and privacy security
people orientedAndroid 11 is committed to highlighting human elements and good at communication.We have reshaped the way you communicate on your mobile phone, and enabled the operating system to identify those who are more important to you, so that you can contact them more quickly.For developers, Android 11 can help you achieve deeper conversations and more personalized interactive experiences in applications.
Session notificationIt will be displayed in the special area at the top of the notice bar. Its design highlights the contact object, and provides session specific operations, such as opening chat in the form of Bubbles, creating session shortcuts in the home screen, and setting reminders.
BubblesIt allows users to keep the conversation visible and interactive when switching between multiple tasks on the mobile phone.Message and chat applications can provide this new experience on Android 11 through the notification based Bubbles API.
Keyboard prompt integration functionThe automatic filling application and IME (Input Method Editor) can safely provide users with context based entities and strings in the IME suggestion column, making input more convenient.
Flexible controlAndroid 11 allows users to quickly access all smart devices and centrally control them.Developers can help users control smart devices and manage media playback through new APIs:
Equipment control(Device Controls)Allows users to access and control their connected devices more quickly and easily.Just long press the power button to call up the device control menu and complete the device control in a one-stop manner.Applications can also appear in this control menu through the new API.Please visit the official documents for details.
Media control(Media Controls)Playback devices that allow users to switch between audio and video content more quickly - whether headphones, microphones, or televisions.Please visit the official documents for details.
Media controlhttps://developer.android.google.cn/preview/features/media-controls
△ Equipment control and media control
Privacy security
In Android 11, we have brought users a higher level of control, allowing them to better manage sensitive permissions.We will also continue to ensure equipment safety through faster updates.
Single authorization– Users can now grant one-time access to the microphone, camera or location information of the device to the app.The application needs to request permission again when it is used next time.Please visit the official documents for details.
Single authorizationhttps://developer.android.google.cn/preview/privacy/permissions
△ Single authorization dialog box in Android 11
Background position– If you want to access the background location information, you need to perform further operations beyond the runtime permissions.If your application needs to access the background location information, the system will require you to request the foreground location permission first.You can further request to access the background location information through a separate permission application, and the system will take the user to the settings page to complete the authorization operation.
Individually request to access location information in the backgroundhttps://developer.android.google.cn/preview/privacy/location#background-location
In addition, it should be noted that we announced in February this year that Google Play developers need to obtain approval to allow applications to access location information in the background to prevent abuse.Now we provide developers with a longer time to make changes. Before 2021, we will not force existing applications to comply with this policy.Please visit the official documents for details.
Request to get location information in the backgroundhttps://support.google.com/googleplay/android-developer/answer/9799150?hl=zh-cn
Automatic permission reset– If a user has not used an application for a long time, Android 11 will "automatically reset" all runtime permissions associated with the application and notify the user.When the user uses the application next time, the application can request permission again.Please visit the official documents for details.
Automatically reset the permissions of unused appshttps://developer.android.google.cn/preview/privacy/permissions#auto-reset
Partitioned storage– We have been working hard to better protect applications and user data on external storage, and have also added more improvements to make migration easier for developers.Please visit the official documents for details.
Storage mechanism update in Android 11https://developer.android.google.cn/preview/privacy/storage
Google Play System Update– Since its release last year, the Google Play system update allows us to update the core components of the operating system more quickly and cover many devices in the Android ecosystem.In Android 11, the number of updatable modules has more than doubled. The 12 new updatable modules have brought better privacy, security and consistency to users and developers.
BiometricPrompt API– Developers can now specify the biometric authentication strength type required by their applications through the BiometricPrompt API to unlock or access sensitive content in applications.For downward compatibility, we have also added these functions to the Jetpack Biometric development library.As the work progresses, we will bring you further updates.
Jetpack Biometric Development Libraryhttps://developer.android.google.cn/jetpack/androidx/releases/biometric
Identity authentication API(Identity Credential API)– This API will bring new usage scenarios, including driver's license, national ID card and digital ID card.We are working with government agencies and industry partners to ensure that Android 11 is ready for a digital identity authentication experience.
Read more about Android 11 privacy features here.
Privacy in Android 11https://developer.android.google.cn/preview/privacy
Practical innovation
Stronger 5G support– Android 11 allows developers to take advantage of the 5G network for faster speed and lower latency.You can know when the user connects to the 5G network, check whether the connection is in billing status, and estimate the bandwidth of the connection.To help you create a 5G experience immediately, we have also added 5G support to the Android Emulator.Please visit the 5G developer page to learn how to use 5G functions on Android.
Simulator support for 5Ghttps://developer.android.google.cn/preview/behavior-changes-all#emulator-5g
Android 5Ghttps://developer.android.google.cn/5g
△ Taking high-speed experience out of your home, 5G can make your accompanying mobile experience more smooth, allowing you to interact with the surrounding environment, friends and family at any time and meet the needs of work
New screen type– Equipment manufacturers are also continuing to innovate and put new screen forms into the market, including hole digging screens and waterfall screens.Android 11 has added support for these screens in the platform and provided corresponding APIs to facilitate your application optimization.You can manage the hole digging screen and waterfall screen through the existing Display Cutout API.You can use the whole waterfall screen by setting new window layout properties, and manage interactions near the screen edge through the waterfall screen insets API.
Support Liu Haipinghttps://developer.android.google.cn/guide/topics/display-cutout
New Window Layout Propertieshttps://developer.android.google.cn/reference/android/view/WindowManager.LayoutParams.html#LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
Call filtering service– Android 11 can help call filtering applications better manage harassed calls.The application can obtain the STIR/SHAKEN verification status of the incoming call in the call details (this standard can prevent ID fraud), and can report the reason for rejecting the call.The application can also customize the post call screen provided by the system to facilitate users to perform operations such as "mark the caller as a harassing phone" or "add to the contact".
Call back screenhttps://developer.android.google.cn/reference/android/telecom/TelecomManager.html#ACTION_POST_CALL
Optimization and quality
Operating System Resilience– In Android 11, we fine tune memory recycling operations (such as forcing users to restart processes that they cannot perceive according to RSS HWM thresholds) to make the operating system more dynamic and resilient as a whole.In addition, in order to improve performance and memory usage, Android 11 also adds Binder cache, which optimizes IPC calls with high usage by caching system services that retrieve relatively static data.Binder caching also extends battery life by reducing CPU time.
Synchronize IME switching effect– This is a new set of APIs, allowing you to synchronously adjust the content in the application when IME (Input Method Editor, also known as soft keyboard) and the system bar enter and exit the screen, so as to create a natural, intuitive and smooth IME switching effect more easily.To ensure accurate frame by frame switching, the new WindowInsetsAnimationThe Callback API will inform the application of the change of the border area frame by frame when the system bar or IME moves.In addition, you can control the system UI through the new WindowInsetsAnimationController API, including system bar, IME, immersion mode, etc.Read this blog post to learn more.
△ Left side: Realize IME synchronous switching effect through the edge lining area animation listener
The illustration on the right side shows that the application driven IME experience is realized through WindowInsetsAnimationController
HEIF animated paintable objects– ImageDecoder API now allows you to decode and render image sequence animations stored in HEIF files, facilitating you to introduce high-quality materials, while minimizing traffic consumption and APK size.Compared with GIF animation, HEIF image sequence can significantly reduce the file size.
Comparison with GIF animationhttps://nokiatech.github.io/heif/comparison.html
Native image decoder– Applications can use the new NDK API to decode and encode images (such as JPEG, PNG, WebP) through native code for graphics or post-processing, and because you do not need to bundle external code libraries, you can maintain a smaller APK size.Native decoders can also benefit from Android's ongoing platform security updates.We provide NDK sample code as a reference.
Low latency video decoding in MediaCodec– Low latency video is critical for real-time video streaming applications and services such as Stadia.Video codecs that support low latency playback will return to the first frame of the reflow as soon as possible after decoding begins.Applications can use the new API to check and configure low latency playback for specific codecs.
Variable refresh rate– Applications and games can now set the preferred frame rate for their windows through the new API.Most Android devices update the screen with a refresh rate of 60Hz, but some devices support multiple refresh rates, such as 90Hz and 60Hz, and can be switched at runtime.On these devices, the system will select the best refresh rate for the application based on the preferred frame rate.You can use this API through SDK and NDK.Please visit the official documents for details.
Dynamic resource loader– Android 11 provides a new public API to enable applications to dynamically load resources and materials at runtime.With the Resource Loader framework, you can include a set of basic resources in an application or game, and then load other resources or change the loaded resources as needed during runtime.
Neural Networks API (NNAPI) 1.3– We continue to add operators and controls to support machine learning on Android devices.To optimize common usage scenarios, NNAPI 1.3 adds APIs for priority and timeout, memory domains, and asynchronous instruction queues.The new operator supports advanced models including signed integer asymmetric quantization and branching and looping. The hard swish operator can be used to accelerate the visual model on the next generation of devices (such as MobileNetV3).
Application Compatibility Tools– We try to set most Android 11 behavior changes to be selectable, so as to minimize the impact on compatibility. Unless you set the targetSdkVersion of the application to 30, these changes will not take effect.If you release the application through Google Play, you have more than a year to choose to support these changes, but we recommend starting testing as soon as possible.To help you test, Android 11 allows you to turn on or off many of these changes individually.Please visit the official documents for details.
Test the compatibility of the application with Android 11https://developer.android.google.cn/preview/test-changes
Application Exit Reason– It is very important to understand the reason for the application exiting and its current status - including the device type, memory configuration and running scenario where the application is located.Android 11 makes this easier through the exit reason API: you can use this API to view the details of the application's recent exit.
Data Access Audit– Data access audit enables you to better understand your application's access to user data and the user process from which you access it.For example, it can help you identify unintentional private data access, whether it comes from your own code or other SDKs.Please visit the official documents for details.
Data Access Audithttps://developer.android.google.cn/preview/privacy/data-access-auditing
ADB incremental installation(ADB Incremental)– Using ADB (Android Debug Bridge) to install larger APK in the development process may slow down your work efficiency, especially for Android game developers.Android 11 has brought ADB Incremental, and now the speed of deploying large APK (more than 2GB) from the development machine to Android 11 devices can be increased by as much as 10 times.Please visit the official documents for details.
Kotlin Nullability Note– Android 11 adds nullability annotations to more methods in the public API.Moreover, it upgrades some existing annotations from warnings to errors.This can help you find problems at build time without waiting for runtime to make errors.readThis articleLearn more.
Get your app ready for Android 11
Android 11 is about to reach users, now is the timeComplete your compatibility test and release updatesHas.
Please first focus on the behavior changes for all applications:
https://developer.android.google.cn/preview/behavior-changes-allThe following are the first behavior changes to focus on (no matter how many targetSdkVersions you apply):
Single permission– Users can now grant single use rights to location information, device microphones and cameras.For more information, please visit the official document:https://developer.android.google.cn/preview/privacy/permissions#one-time
External storage access– The application can no longer access the files of other applications in the external storage space.For more information, please visit the official document:https://developer.android.google.cn/about/versions/11/privacy/storage#other-apps-data
Scudo Hardened Allocator– Now it is a heap memory allocator for native code in the application.For more information, please visit the official document:https://developer.android.google.cn/preview/behavior-changes-all#scudo
File Descriptor Profiler– This function is now enabled by default to detect file descriptor processing errors that apply native code.For more information, please visit the official document:
There are many behavior changes that can be supported in Android 11 – your application will be affected if it is released for a new platform.We recommend that you evaluate these changes as soon as possible after you release a compatible version of the application.For more information on compatibility tests and tools, seeAndroid 11 compatibilityRelated resources, and visit the Android 11 developer website for technical details.
Improve your applications with new features and APIs
When you're ready, take a closer look at Android 11 and learn about the new features and APIs you can use.Here are some key features you can prioritize.
New features and APIshttps://developer.android.google.cn/about/versions/11
We recommend that all applications support these features:
Dark theme(Supported since Android 10) – By adding Dark Theme or enabling Force Dark, it ensures a consistent experience for users who enable dark themes throughout the system.
Gesture navigation(Supported since Android 10) – Please support gesture navigation, including providing an edge to edge immersive experience, and ensuring that custom gestures work well with default gestures.For more information, please visit the official document:https://developer.android.google.cn/training/gestures/gesturenav
Share Shortcuts(Supported since Android 10) – Applications that want to receive shared data should use the shared shortcut API to create shared targets.Applications that want to send shared data should be sure to use Android Sharesheet.
Synchronize IME switching effect– Use the new WindowInsets and related APIs to provide users with smooth switching effects.For more information, please read this blog post:https://medium.com/androiddevelopers/animating-your-keyboard-fb776a8fb66d
New screen type– For hole digging screen or waterfall screen equipment, make sure to test and adjust your content for these screens as needed.For more information, please visit the official document:
We also recommend these features, if they match your application experience:
conversation– Messaging and communication applications can integrate the user's conversation experience by providing long-term sharing shortcuts and presenting conversations in notifications.Please visit the official documents for details.
Chat bubble(Bubbles)– Bubbles can keep the conversation visible and available during multi task switching.The application implements this function through the notification based Bubbles API.https://developer.android.google.cn/guide/topics/ui/bubbles
5G– If your application or content can take advantage of 5G's faster speed and lower latency, please refer to our developer resources to start building a 5G experience.https://developer.android.google.cn/5g
Equipment control– If your app supports external smart devices, please ensure that these devices can be accessed from the new Android 11 device control menu.Please visit the official documents for details.https://developer.android.google.cn/preview/features/device-control
Media control– For media applications, we recommend supporting Android 11 media control, so that users can manage media playback from the Quick Settings menu.Please visit the official documents for details.
You can go to developer.android.google.cn/11 to learn more about the features of Android 11.
Android 11 will appear on the device next to you!
Android 11 will be launched on selected Pixel, OnePlus, Xiaomi, OPPO and realme mobile phones from today. More partners will launch and upgrade devices in the coming months.If you own Pixel 2, 3, 3a, 4 or 4a series mobile phones, including those that participated in this year's beta test plan, please follow the upcoming OTA update!
The Android 11 factory system image of Pixel devices can also be obtained through the Android Flash Tool, or you can download it here.As always, you can get the latest Android simulator system image through the SDK Manager in Android Studio.If you want to conduct more extensive testing on other compatible devices that support Treble, you can obtain the Generic System Image (GSI) here.
Android Flash Toolhttps://flash.android.com/
Download System Imagehttps://developers.google.cn/android/images
Get GSI imagehttps://developer.android.google.cn/topic/generic-system-image/releases
If you need the source code of Android 11, you can get it at this address under the Android 11 branch of the Android open source project repo.
Android Open Source Projecthttps://source.android.google.cn/
We will soon close the problem feedback channel of the preview version and clear the open bugs for the developer preview version or beta version. If you find again the problems that were submitted during the preview version, please submit a new error report for Android 11 in the AOSP problem feedback form. We hope you will continue to provide us with feedback!
Thanks again to many developers and early experimenters who participated in the preview plan this year!Everyone has provided us with very good feedback to help us polish our products.It is the thousands of problem reports submitted by everyone that make Android 11 a better and more suitable platform for users.Look forward to seeing your applications on Android 11!Transferred from Google developer official account:https://mp.weixin.qq.com/s/XF6yOGUdwngWzMQ54hS9kw
Statement:All articles on this site, unless otherwise specified or marked, are originally published on this site.No individual or organization is allowed to copy, embezzle, collect and publish the content of this website to any website, book and other media platforms without the consent of this website.If the content of this website infringes upon the legitimate rights and interests of the original author, please contact us for handling.