Android 11 is officially released | The stage for developers is ready

 

Android 11 is here! Android 11 focuses on three themes:  people-oriented communication, allowing users to quickly access and flexibly control all smart devices, and giving users more ways to control the privacy and security of how data on the device is shared . Please read our official blog for details.

 

  • Android Open Source Project

    https://source.android.google.cn/

  • Android 11 official blog

    http://blog.google/products/android/android-11

 

For developers, Android 11 brings a lot of new features, including session notifications, device and media control, single permissions, enhanced 5G support, IME switching effects, etc. You are welcome to try them actively. To help you advance your development work faster, we have also added new tools, such as compatibility switch, ADB incremental installation, application exit reason API, data access audit API, Kotlin nullability annotation, etc. All these work are to make developers love Android 11, and we look forward to seeing your work on it!

 

The official version of Android 11 is also about to debut on the devices around you. Pixel 2, 3, 3a, 4 and 4a series devices will be updated today. Please visit the Android 11 developer site for details.

 

  • Android 11 developer site

    https://developer.android.google.cn/about/versions/11

 

 

People-oriented, flexible control and privacy security

 

people oriented

Android 11 is committed to highlighting the elements of people and being good at communication. Google has reshaped the way you communicate on your mobile phone, and it also allows the operating system to recognize those who are more important to you so you can contact them more quickly. For developers, Android 11 can help you achieve deeper conversations and more personalized interactive experiences in apps.

  • Conversation notifications will be displayed in a special area at the top of the notification bar. The design highlights the contact person and provides conversation-specific operations, such as opening chat in the form of Bubbles, creating conversation shortcuts on the home screen, and setting reminders.

  • Bubbles  allows users to keep the conversation visible and interactive when switching between multiple tasks on the phone. Messaging and chat applications can provide this new experience on Android 11 through the notification-based Bubbles API.

  • The keyboard prompt integration function allows the auto-fill application and IME (input method editor) to safely provide users with context-based entities and strings in the IME suggestion bar, making input more convenient.

     

  • Bubbles API

    https://developer.android.google.cn/guide/topics/ui/bubbles

△ Bubbles and people-oriented conversation

Flexible control

Android 11 allows users to quickly access all smart devices and centrally control them. Developers can use new APIs to help users control smart devices and manage media playback:

  • Device Control ( Device Controls ) allow users to more quickly and easily access and control devices connected to them. Just long press the power button to bring up the device control menu, and complete device control in one stop. Applications can also appear in this control menu through the new API. For more information, please visit the official documentation.

  • Media Controls ( Media Controls ) allow users to more quickly switch audio and video content playback devices-whether it is a headset, microphone or TV. For more information, please visit the official documentation.

 

  • equipment control

    https://developer.android.google.cn/preview/features/device-control

  • Media control

    https://developer.android.google.cn/preview/features/media-controls

 

 

△ Device control and media control

Privacy security

In Android 11, we bring users a higher level of control, allowing them to better manage sensitive permissions. We will continue to ensure equipment safety through faster updates.

 

Single authorization  -Users can now grant applications one-time permissions to access the device's microphone, camera, or location information. The application needs to request permission again when it is used next time. For more information, please visit the official documentation.

 

  • Single authorization

    https://developer.android.google.cn/preview/privacy/permissions

△ Single authorization dialog in Android 11

Background location  -Want to access the background location information now requires the user to perform further operations besides granting runtime permissions. If your application needs to access the background location information, the system will ask you to request the foreground location permission first. You can further request access to the background location information through a separate permission application, and the system will take the user to the Settings page (Settings) to complete the authorization operation.

 

  • Separate request to access location information in the background

    https://developer.android.google.cn/preview/privacy/location#background-location

 

Another thing to note is that Google announced in February this year that Google Play developers need to obtain approval before allowing apps to access location information in the background to prevent abuse. Google now provides developers with more time to make changes. Google will not force existing applications to comply with this policy before 2021. For more information, please visit the official documentation.

 

  • Request location information in the background

    https://support.google.com/googleplay/android-developer/answer/9799150?hl=zh-cn

 

Automatic resetting of permissions  -If the user has not used an app for a long period of time, Android 11 will "automatically reset" all runtime permissions associated with the app and notify the user. When the user uses the app next time, the app can request permission again. For more information, please visit the official documentation.

 

  • Automatically reset permissions of unused apps

    https://developer.android.google.cn/preview/privacy/permissions#auto-reset

 

Partitioned storage  -Google has been working hard to better protect applications and user data on external storage, and has also added more improvements to make it easier for developers to migrate. For more information, please visit the official documentation.

 

  • Storage mechanism update in Android 11

    https://developer.android.google.cn/preview/privacy/storage

 

Google Play system update  -Since its release last year, the Google Play system update has allowed 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 updateable modules has more than doubled, and 12 new updateable modules have been added to bring better privacy, security and consistency to users and developers.

 

BiometricPrompt API  -Developers can now use the BiometricPrompt API to specify the type of biometric authentication strength required by their application to unlock or access sensitive content in the application. For backward compatibility, Google also added these functions to the Jetpack Biometric development library. As the work progresses, Google will bring you further updates.

 

  • BiometricPrompt API

    https://developer.android.google.cn/preview/features#biometric-auth

  • Jetpack Biometric Development Library

    https://developer.android.google.cn/jetpack/androidx/releases/biometric

 

Identity Credential API ( Identity Credential API ) -This API will bring new usage scenarios, including driver licenses, national ID cards and digital ID cards. Google is working with various government agencies and industry partners to ensure that Android 11 is ready for the digital identity authentication experience.

 

Read more about Android 11 privacy features here.

 

  • Privacy in Android 11

    https://developer.android.google.cn/preview/privacy

 

 

Practical innovation

 

Stronger 5G support  -Android 11 allows developers to take advantage of the faster speed and lower latency of 5G networks. You can know when a user is connected to the 5G network, check whether the connection is billed, and estimate the bandwidth of the connection. To help you create a 5G experience instantly, we have also added 5G support to the Android Emulator. Please visit the 5G developer webpage to learn how to use 5G features on Android.

 

  • Detect 5G

    https://developer.android.google.cn/preview/features/5g#how-to-detect

  • Check the flow rate

    https://developer.android.google.cn/preview/features/5g#meteredness

  • Bandwidth estimation

    https://developer.android.google.cn/preview/features/5g#estimator

  • Emulator support for 5G

    https://developer.android.google.cn/preview/behavior-changes-all#emulator-5g

  • Android 5G

    https://developer.android.google.cn/5g

△ Taking the high-speed experience out of your home, 5G can make your accompanying mobile experience smoother, allowing you to interact with the surrounding environment, friends, and family at any time and meet your work needs

New screen types  -Equipment manufacturers are also continuing to innovate, putting new screen forms into the market, including hole-digging screens and waterfall screens. Android 11 has added support for these screens to the platform, and provides corresponding APIs to facilitate your application optimization. You can manage cutout screens and waterfall screens through the existing Display Cutout API. You can use the entire waterfall screen by setting new window layout properties, and manage the interaction near the edge of the screen through the waterfall screen edge (insets) API.

 

  • Support Liu Haiping

    https://developer.android.google.cn/guide/topics/display-cutout

  • New window layout properties

    https://developer.android.google.cn/reference/android/view/WindowManager.LayoutParams.html#LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS

  • Waterfall screen edge area

    https://developer.android.google.cn/reference/android/view/DisplayCutout.html#getWaterfallInsets()

 

Call filtering service  -Android 11 can help call filtering applications better manage harassing calls. The application can obtain the STIR/SHAKEN verification status of the incoming call in the call details (this standard can prevent incoming call ID fraud), and can report the reason for rejecting the call. The app can also customize the post call screen provided by the system to facilitate users to perform operations such as "mark the caller as a nuisance phone" or "add to a contact".

 

  • STIR/SHAKEN verification status

    https://developer.android.google.cn/reference/android/telecom/Call.Details.html#getCallerNumberVerificationStatus()

  • Screen after call

    https://developer.android.google.cn/reference/android/telecom/TelecomManager.html#ACTION_POST_CALL

 

 

Optimization and quality

 

Operating system flexibility  -In Android 11, we fine-tuned memory recycling operations (such as forcing user-insensitive process restarts based on RSS HWM thresholds) to make the overall operating system more dynamic and flexible. In addition, in order to improve performance and memory usage, Android 11 also adds Binder caching, which optimizes IPC calls with high usage rates by caching those system services that retrieve relatively static data. Binder cache also extends battery life by reducing CPU time.

 

Synchronous IME switching effects  -This is a new set of APIs that allow you to synchronize the content in the application when the IME (input method editor, also called soft keyboard) and system bar enter and exit the screen, making it easier to create natural, Intuitive and smooth IME switching effect. In order to ensure that the switching is accurate frame by frame, the new WindowInsetsAnimation.Callback API will notify 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 WindowInsetsAnimationControllerAPI, including system bar, IME, immersion mode, etc. Read this blog post to learn more.

 

  • WindowInsetsAnimation.Callback

    https://developer.android.google.cn/reference/android/view/WindowInsetsAnimation.Callback

  • WindowInsetsAnimationController

    https://developer.android.google.cn/reference/android/view/WindowInsetsAnimationController

  • Keyboard animation effect

    https://medium.com/androiddevelopers/animating-your-keyboard-fb776a8fb66d

 

 

△ On the left: IME synchronization switching effect is realized through the animation monitor of the border area 

Schematic on the right: Realize application-driven IME experience through WindowInsetsAnimationController

HEIF Animated Drawable 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 data consumption and APK size. Compared with GIF animation, HEIF image sequence can significantly reduce file size.

 

  • ImageDecoder API

    https://developer.android.google.cn/reference/android/graphics/ImageDecoder

  • Comparison with GIF animation

    https://nokiatech.github.io/heif/comparison.html

 

Native image decoder  -apps 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 don’t need to bundle external code libraries, they can be kept small APK size. Native decoders can also benefit from Android's continuous platform security updates. We provide NDK sample code for reference.

 

  • NDK API

    https://developer.android.google.cn/ndk/guides/image-decoder

  • NDK sample code

    https://github.com/android/ndk-samples/tree/master/teapots/image-decoder

 

Low-latency video decoding in MediaCodec  -Low-latency video is essential 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 stream as soon as the decoding starts. Applications can use the new API to check and configure low-latency playback for specific codecs.

 

  • Stadia

    https://stadia.google.com/

  • Check codec function

    https://developer.android.google.cn/reference/android/media/MediaCodecInfo.CodecCapabilities#isFeatureSupported(java.lang.String)

  • Configure codec low latency function

    https://developer.android.google.cn/reference/android/media/MediaCodec.html#PARAMETER_KEY_LOW_LATENCY

 

Variable refresh rate  -Apps and games can now set the preferred frame rate for their windows through the new API. Most Android devices update the screen at 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 selects the best refresh rate for the application based on the preferred frame rate. You can use this API through SDK and NDK. For more information, please visit the official documentation.

 

  • setFrameRate

    https://developer.android.google.cn/reference/android/view/Surface#setFrameRate(float,%20int)

  • Frame rate API

    https://developer.android.google.cn/preview/features#frame-rate-api

 

Dynamic Resource Loader  -Android 11 provides a new public API to allow apps 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 as needed during runtime, or change the loaded resources.

 

  • Resource Loader framework

    https://developer.android.google.cn/reference/android/content/res/loader/package-summary.html

 

Neural Networks API (NNAPI) 1.3  -We continue to add operators and controls to support machine learning on Android devices. In order 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, and the hard-swish operator can be used to accelerate visual models on next-generation devices (such as MobileNetV3).

 

  • MobileNetV3

    https://ai.googleblog.com/2019/11/introducing-next-generation-on-device.html

 

 

Developer experience

 

App Compatibility Tool  -Google strives to set most Android 11 behavior changes to be optional to minimize the impact on compatibility. These changes will not take effect unless you set the app’s targetSdkVersion to 30. If you are publishing your 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 individually turn on or turn off many of these changes. For more information, please visit the official documentation.

 

  • targetSdkVersion

    https://developer.android.google.cn/distribute/best-practices/develop/target-sdk

  • Test app compatibility with Android 11

    https://developer.android.google.cn/preview/test-changes

 

Application exit reason  -It is important to understand the reason why the application exits and its status at the time-including the type of device the application is on, memory configuration and operating scenarios. Android 11 makes this easier with the exit reason API: you can use this API to view the details of the app’s recent exit.

 

  • App exit reason API

    https://developer.android.google.cn/reference/kotlin/android/app/ActivityManager#gethistoricalprocessexitreasons

  • View application exit details

    https://developer.android.google.cn/reference/android/app/ApplicationExitInfo

 

Data access audit  -Data access audit allows you to better understand how your application accesses user data and the user flow from which the access comes. For example, it can help you identify unintentional private data access, whether it comes from your own code or another SDK. For more information, please visit the official documentation.

 

  • Data access audit

    https://developer.android.google.cn/preview/privacy/data-access-auditing

 

ADB Incremental ( ADB Incremental ) -During the development process, using ADB (Android Debug Bridge) to install large APKs may slow down and affect your work efficiency, especially for Android game developers. Android 11 brings ADB Incremental, and now the speed of deploying large APKs (above 2GB) from the development machine to Android 11 devices can be increased by as much as 10 times. For more information, please visit the official documentation.

 

  • ADB incremental APK installation

    https://developer.android.google.cn/preview/features#incremental

 

Kotlin Nullability Annotation  -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 errors at runtime. Read this article to learn more.

 

 

Prepare your app for Android 11

 

Android 11 is about to arrive in the hands of users, now it’s time to complete your compatibility test and release an update .

Please pay attention to the behavior changes for all apps first:

https://developer.android.google.cn/preview/behavior-changes-all

 

The following are the behavior changes that you need to pay attention to first (regardless of the targetSdkVersion of your app): 

  • Single access  -Now, users can grant single access to location information, device microphone and camera. For more information, please visit the official document:

    https://developer.android.google.cn/preview/privacy/permissions#one-time

  • External storage access permissions  -apps can no longer access files of other apps 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  Checker-This feature is now enabled by default to detect file descriptor processing errors in the application's native code. For more information, please visit the official document:

    https://developer.android.google.cn/preview/behavior-changes-all#fdsan

 

There are also many optional behavior changes in Android 11-your app will only be affected if it is released for a new platform. We recommend evaluating these changes as soon as possible after you release a compatible version of your app. For more information about compatibility testing and tools, please check  the resources related to Android 11 compatibility , and visit the Android 11 developer website for technical details.

 

  • Behavior change: apps targeting Android 11

    https://developer.android.google.cn/preview/behavior-changes-11

  • Android 11 developer site

    https://developer.android.google.cn/11

 

 

Improve your app with new features and APIs

 

When you are ready, please dive into Android 11 and learn about the new features and APIs you can use. Here are some key features that you can prioritize.

 

  • New features and API

    https://developer.android.google.cn/about/versions/11

 

We recommend that all apps support these features:

  • Dark theme  (supported since Android 10)-By adding Dark Theme (dark theme) or enabling Force Dark, ensure a consistent experience for users who enable system-wide dark theme.

    https://developer.android.google.cn/guide/topics/ui/look-and-feel/darktheme

    https://developer.android.google.cn/guide/topics/ui/look-and-feel/darktheme#force_dark

  • 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

  • Sharing shortcuts  (supported since Android 10)-Apps that want to receive shared data should use the sharing shortcut API to create shared targets. Apps that want to send shared data should make sure to use Android Sharesheet.

    https://developer.android.google.cn/training/sharing/receive#sharing-shortcuts-api

    https://developer.android.google.cn/training/sharing/send#why-to-use-system-sharesheet

  • Synchronous IME switching effects  -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 types  -For digging screens or waterfall screens, make sure to test and adjust your content for these screens as needed. For more information, please visit the official document:

    https://developer.android.google.cn/preview/features#screens

 

We also recommend these features if they fit your app experience:

  • Conversation  -Messaging and communication applications can integrate into the user's conversation experience by providing long-term sharing shortcuts and presenting the conversation in notifications. For more information, please visit the official documentation.

    https://developer.android.google.cn/training/sharing/receive#publish-direct-share-targets

    https://developer.android.google.cn/preview/features/conversations

  • Chat Bubbles ( Bubbles )-Bubbles can still keep the dialogue visible and usable when switching between multiple tasks. 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

  • Device control  -If your app supports external smart devices, make sure these devices can be accessed from the new Android 11 device control menu. For more information, please visit the official documentation.

    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. For more information, please visit the official documentation.

    https://developer.android.google.cn/preview/features/media-controls

 

You can go to developer.android.google.cn/11 to learn more about Android 11 features.

 

 

Android 11 is about to appear on devices near you!

 

Android 11 will be launched on selected Pixel, OnePlus, Xiaomi, OPPO and Realme phones from today, and more partners will launch and upgrade devices in the coming months. If you have a Pixel 2, 3, 3a, 4 or 4a series phone, including those that participated in this year’s Beta test program, please pay attention to the upcoming OTA update!  

 

The Android 11 factory system image for 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 emulator system image through SDK Manager in Android Studio. If you want to perform more extensive testing on other compatible devices that support Treble, you can get the Generic System Image (GSI) here.

 

  • Android Flash Tool

    https://flash.android.com/

  • Download system image

    https://developers.google.cn/android/images

  • Get GSI image

    https://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 Project

    https://source.android.google.cn/

  • Android 11

    https://android.googlesource.com/?format=HTML

 

 

Guess you like

Origin blog.csdn.net/MYBOYER/article/details/108507833