storage

01

Q: Is partition storage mandatory for Android 11? If targetSdkVersion is lower than Android 10 and running on Android 11 phones, does the partition storage feature still work?

When the application’s targetSdkVersion is upgraded to Android 11, the partitioned storage feature takes effect. However, if the application targetSdkVersion is not upgraded to Android 11, partition storage will not take effect when running on Android 11. However, according to Google Play’s policy, all new releases of targetSdkVersion need to be upgraded to that version or higher in August of each major Android release, and in November of each release, All applications targetSdkVersion need to be upgraded to this version or later.

02

Q: How does a cleansing tool help users clear data in an application-specific directory?

The MANAGE_EXTERNAL_STORAGE permission is applicable to cleanup, file management, backup, or restore applications. The MANAGE_EXTERNAL_STORAGE permission is controlled by Google Play to protect permissions from abuse. Cleaning applications can access all external storage, but also cannot access other applications’ exclusive directories. In partitioned storage, the app’s exclusive directory is understood to be equivalent to internal storage and is not accessible in Android 11. If a cleaning application can access another application’s dedicated directory, it will still choose to store its data in internal storage to protect its own data. This is different from the purpose of partition storage. Therefore, it can also be considered as “internal storage”.

03

Q: After Android 11, will there be no chance for third-party apps like file manager or Sweepmaster to access files generated in the exclusive domain of other apps?

Yes, if third-party file management applications still have access to files in the proprietary directories generated by other applications, then these applications can further choose to put application files in internal storage, which is not a good application specification for external storage.

permissions

01

Q: As for the manufacturer’s custom permissions, Google’s permission design method is not adopted, which leads to various compatibility problems in application development. Will you consider allowing the manufacturer to unify? For example, floating window permissions (even affecting the use of Toast), app list access permissions, and various sensor permissions not defined by Google.

If you find that your app is performing differently on different phones during development, especially if you think that the behavior logic of a particular phone is inconsistent with CDD, please let us know. In general, the Android SDK should behave the same on all Android phones, but we know that some manufacturers will add some new features. For example, some phones will have a power optimization feature, which will affect the notification function of the phone, and may affect the user experience and application functions to some extent.

If there are some features that are only available on some handset vendors, because Android is open source, vendors can add new features themselves. For this part, we also hope that you can give us feedback and let us know some features that are friendly to developers and users, and we hope that they can be added to AOSP. We can also work with vendors, developers, and users to make Android as a whole better.

CDD

Source. The android. Google. Cn/compatibili…

02

Q: when did shouldShowRequestPermissionRationale is true? On what basis? Have you ever been denied?

Because this is a system-level API, you just need to call it and do the appropriate thing with the return value. In principle, if the user rejects once and does not select the “Don’t ask me again” option, then the next return value should be true. For more detailed implementation details, see the corresponding source code in AOSP. For application developers, it’s all about the return value.

The related documents

Developer. The android. Google. Cn/training/PE…

03

Q: Does Android 11 have any impact on the location of a single process (a single service is opened, and the process name is specified as background process)?

If a process is a background process, the application must have the background location permission to obtain location information. For some special cases, there will be specific processing, such as the application in the background but open the foreground service, through a continuous notification to let the user feel that it is running in the background, in this case, we will think that the application is the foreground application, then the application has the foreground positioning permission can obtain location information.

04

Q: Will the callback after access be accurate to which interface is involved in sensitive information? For example, requestLocationUpdate involves location information.

Setting up the data access operation callback API is still in the Developer Perview stage and will be improved according to actual requirements. For example, sometimes we need to know that the user’s behavior may be related to certain permissions, and whether the permissions and application code requirements are consistent. You don’t need to use this API if you already know what code is used to do the specific operations. If you don’t know what code you’re doing it with, or if a third-party library is running as a result, this API can be very helpful. Again, refer to actual use cases.

05

Q: Will Android 11 disable applications to change the location of the system? Or check whether the application uses virtual location?

If you change the system location, you may need Root permission, which is not the user experience we normally consider. Some developers check for virtual locations by checking if there are any apps on the device that are specifically designed to change locations. If you want to do this in Android 11, you need to consider app visibility, by listing the package name in the Mainfest file.

06

Q: Do I always apply for one-time permission? Is there a whitelist mechanism? For example, I am a camera application. If I keep applying for camera permissions, there may be some experience problems.

One-off permissions are granted by users. Applications cannot apply for one-off permissions explicitly. What the application does is tell the user to apply for permissions, and then the user chooses whether to grant one-time permissions or long-term permissions, which is transparent to the application. For application developers, we recommend that you follow the practice guidelines, and each time you need permission, you should check to see if you have permission, and if you don’t, you should follow the practice guidelines to apply for permission. When the user grants the corresponding permission, it can continue to run; If the user does not grant the permission, you can also ask the user to explain why the permission is required, so that the user knows the necessity of applying for the permission.

A one-time permission documents: developer. The android. Google. Cn/preview/pri…

CameraX

01

Q: Will CameraX work with more vendors to provide customized features?

Last year at I/O we launched CameraX, a Jetpack support library designed to simplify camera application development. So far, we are working with Samsung, OPPO, Xiaomi, LG, etc., as well as some other manufacturers themselves. More depends on the vendor’s willingness to develop mobile features, and since CameraX is an open source project, we don’t have to work directly with the vendor.

New screen types

01

Q: Has Android 11 improved support for folding screens?

Android 11 has added some apis for the state of foldable devices. For example, in the second Developer preview, an API was added to detect the opening and closing Angle of the device’s hinges so that apps can display different content based on the opening and closing Angle and position of the hinges.

Privacy/Security

01

Q: How does the Android system provide better support from the bottom up for being broken?

Foreign developers only need to upload their apps to The Google Play App Store to effectively protect the game and the interests of players through the security mechanism of Google Play, and reduce the problem of game tampering and piracy. If an app is broken or uploaded to the Play Store, the original developer can ask Play to find out and take it down.

However, the domestic ecology is relatively fragmented at present, and there are many release channels, so anti-breach is a more important demand. After knowing this situation, we also established close contact with many reinforcement manufacturers. Since Android O our has been support some vendor’s reasonable requirements, such as Android 10 has added a new public interface, AppComponentFactory. InstantiateClassLoader (), Create and set up a custom ClassLoader before the application is loaded to run other code for hardening and hotfix solutions. In Android 11, we added the ResourcesLoader API, which allows hardening and hot fixes to load customized resources through system-supported interfaces. We will continue to work with hardening vendors to improve hardening, minimizing the use of proprietary apis in order to gain full system-level support. For application developers, after selecting these hardening solutions, they can also better ensure the compatibility of their applications with future versions of Android.

02

Q: in the intent of the action to write android. The intent. The action. The Main is equivalent to whether can query all App installed? Because almost all apps declare this intent action.

The change in package visibility was added to protect user privacy, rather than allowing apps to query all apps on the phone. At present for which there is no limit to some action can query, but trust is not allowed in the final version for android. The intent. The action. The Main query, unable to get the results.

03

Q: What are the limitations of the grey list? Is the other JAR package inaccessible?

The grey list has no relation to other JAR packages. No matter in any channel, there is no problem in calling the grey list at present, but there is no guarantee that non-SDK interfaces in the grey list will be moved to the blacklist in the future version, so we suggest that non-SDK interfaces in the grey list be called as little as possible. If the non-SDK interface is in the dark gray list, it indicates that the non-SDK interface is differentiated by targetSDKversion. Different versions have different restrictions on whether they can be called. This restriction has nothing to do with the jar package not being accessible, regardless of where the interface is called from.

  • Non-sdk interfaces restrict documents

Developer. The android. Google. Cn/distribute /…

04

Q: Foreign targetSdkVersion can be controlled by Google Play Policy. In domestic environment, targetSdkVersion of APK can not be upgraded, but can also be installed and used to continue to access user privacy data in the new Android system. Do you have any ideas on this direction?

In fact, we can also see that the domestic ecosystem is paying more and more attention to privacy and security. Previously, we also saw that the Ministry of Industry and Information Technology, together with mainstream domestic app stores, has upgraded the targetSdkVersion. Although it may be slower than our requirements, at least it is constantly upgrading. In addition, for older applications with targetSdkVersion, there will be some system level restrictions starting from Android 10. For example, applications with targetSdkVersion less than 17 will be alerted to the user during installation and each run. These initiatives are also aimed at bringing together all participants in the Android ecosystem to promote targetSdkVersion, with the hope that all applications will be upgraded to a higher version of targetSdkVersion to give users a better security and privacy experience.

Application package visibility

01

Q: Does the visibility of application package name affect deeplink and applink functions?

Deeplink and Applink will not be affected by the package name visibility change, because the underlying system will be changed, so there is no change in theory for the application to continue using Deeplink and Applink. If you are starting a new service or have started other applications, you cannot start components of other applications if your application cannot see other applications.

API

01

Q: Will Android 10 or Android 11 use the Blacklist or grey list API and be rejected by Google Play?

If an app uses a blacklisted interface, there may be a runtime exception that prevents the app from working properly, and Google Play will reject the app. The restriction of private list is implemented at the level of Android system. The purpose of this restriction is not to restrict developers. When developers encounter problems with their applications, they can consider whether they have to use this interface, or they can also feedback to us reasonable requirements, hoping to open open SDK interface to meet corresponding requirements.

SDK

01

Q: How will this affect apps with targetSdkVersion other than Android 11?

Every time we update a new version, we consider minimizing the impact on the application. From this point of view, we try to put the behavior changes after the targetSdkVersion upgrade. If the application has not been upgraded to the latest targetSdkVersion, it will not be affected by the behavior change. If your existing application already follows our practice guidelines, the impact of the change will be minimal. But since we’ve made some changes to the bottom of the system in Android 11, such as permissions management, one-time permissions, and some changes to partition storage, we also want you to be able to debug your apps in the Android 11 emulator or real machine to make sure there are no problems.

Android 11 Behavior Change Guidelines:

Developer. The android. Google. Cn/preview /;…

02

Q: Can you explain how targetSdkVersion works? For example, for apps running on Android 11, Android will execute different code according to targetSdkVersion = 30/29/28?

Every time we release a new version of Android, like the upcoming Android 11, the changes fall into two categories. The first type of change is long-term, regardless of targetSdkVersion, as long as the change is running in the system. The second type is to determine specific behavior based on targetSdkVersion. If changes are made according to targetSdkVersion, some changes only apply to applications with targetdkVersion 30 or above, and your application with targetSdkVersion 29 or below, these changes will not affect your application behavior. These changes will only take effect if you upgrade to targetSdkVersion 30 or above.

Reference Documents:

Developer. The android. Google. Cn/preview /;…

other

01

Q: What are the recent updates for Android virtual machines?

In March, we released an update about virtual machines. Currently, the latest version of virtual machines can directly run ARM applications, without building x86 versions, and can directly use ARM versions. Virtual machines can efficiently convert ARM instructions directly to x86 instructions, and running ARM applications directly can also achieve good performance. You are welcome to try it.

02

Q: Does Android consider using methods that pass callback parameters to handle callbacks? Currently, this Activity callback form is quite inconvenient to use.

In Java, if you are familiar with Java Callback, the syntax may be complicated to use. In fact, other languages have similar concepts that support Lambda Expression and Functional Programming. If you haven’t already used Kotlin, we strongly encourage you to do so, as there is first-class citizen support for Lambda expressions. Try Kotlin if you can.

03

Q: Is the size of the picture-in-picture window now customizable?

You can set the ratio of width to height by using setAspectRatio(), but you cannot specify a specific dimension. The size of the drawing – in – picture window should be determined by the user.

04

Q: does < queries> support dynamic code setting?

Currently, tags can only be defined in the manifest and cannot be designed dynamically at application runtime.

05

Q: General App may have channel package, such as com.example.xiaomi com.example.huawei. Can I write com.example.* in the manifest < queries>?

Currently, getPackageInfo or getInstalledPackages are used in the manifest to check whether an application is installed. Only the full application package name can be used.

06

Q: Is there any Demo reference for input method animation? Is there a way to use lower versions like Android 10?

GitHub provides an example. For a more complete understanding, see the sample code: github.com/android/use…

This latest API is currently only available in Android 11, not in earlier versions. We will also evaluate whether it can be supported on older versions of Android.

07

Q: How detailed is the crash exit information for ApplicationExitInfo? Is it only available after the crash when the app is launched next time?

When an application crashes, information is stored in a buffer that is immediately accessible to the application. Typically, when an app crashes, the user will try to open the app again, so the crash exit information can be reported to the background the next time the app is opened, and the developer can look at the exact cause of the crash.

08

Q: The functions of OBB and AAB overlap. Can the initial download of OBB be guaranteed? Or what are the best practices for OBB scenarios?

In fact, there is no overlap between OBB and App Bundle itself. OBB is designed for games with large resource bundles. Play allows up to two OBB files per game, each with a maximum of 2GB, so it can contain up to 4GB of resource bundles. However, App Bundle has a relatively strict download size limit, so 4GB resource bundles cannot be downloaded. It can be simply understood that OBB is built for games, while App Bundle is built for other applications. Last month, we launched a product similar to App Bundle for game applications called Play Asset Delivery, which allows games to be divided into multiple modules and distributed in the same way as App Bundles.

Reference: Google Play optimizes high quality game delivery

09

Q: Are there any limitations or enhancements to Accessibility on Android 11?

Android has been getting better and better support for accessibility in recent releases. There won’t be any more restrictions in Android 11, and there will be some feature enhancements. Stay tuned for Android 11, and we’ll probably have some new accessibility features announced in future developer previews or Beta releases.

The upcoming Android 11 Beta

The fourth Developer preview of Android 11 is now available, with the latest bug fixes, API updates, and the latest features for your apps to test. To better address the challenges, we’ve updated the release schedule, and Beta 1 will be released on June 3rd. In order to give you a better introduction to Beta 1 and provide you with The technical resources you need, we will be hosting an online developer event, Android 11: The Beta Launch Show.

Check out the Android 11 developer website for more details, and keep sharing your thoughts with us!

Android 11 developer website

developer.android.google.cn/preview

Share usage feedback

Developer. The android. Google. Cn/preview/fee…