Android 12 first developer Preview

Time:2021-9-28

Author / Dave Burke, vice president of Engineering

Android 12 first developer Preview

From mobile phones and laptops to tablets, TVs and even cars, Android applications support the work, entertainment, communication and creation of billions of people on various devices every day. When more and more people begin to rely on the experience you build, people’s expectations rise with the tide. We firmly believe that the feedback from Android developers will help us build a better platform for your application and all users. We have released the first developer preview of Android 12 (the next generation Android system) for you to test and submit feedback.

For each version, we are committed to making the operating system smarter, easier to use and more powerful, and always focus on privacy and security. In Android 12, we will also provide you with new tools to help you create a better experience for users. The first is compatible media transcoding. Even if your application does not support it, this function can help the application use the latest video format. In addition, rich media content such as images and videos can now be copied / pasted into your application more easily. We will also add privacy protection and optimize performance to keep your app responsive.

The first preview version is just the beginning of Android 12. With the release, we will share more content with developers. Please continue reading this article to learn about the latest changes in Android 12 and visitAndroid 12 developer website, get information aboutDownload and install to pixel deviceandRelease scheduleDetails of. As usual, it is very important for us to get your feedback as soon as possible and incorporate it into the final product, so please be carefulDon’t tell us what you think

In addition to what we have done in Android 12, we have also released the latest progress of another important tool, which is j, which can help you create an excellent user experience more easilyetpack Compose, this is our next generation toolkit for building native interfaces. You are welcome to leave a message in the comments area and tell us the most concerned issues about jetpack compose.

Trust and security

Privacy is the core of all our work. In Android 12, we continue to focus on providing users with more transparency and control, while ensuring the security of devices and data. In the new version, we have made many changes, including adding new restrictions on identifiers that can be used for tracking, adding more secure default values for application components, and so on. These changes may have an impact on the application, so we recommend that you start testing as soon as possible. At the same time, please continue to pay attention to more privacy and security features that will be provided in subsequent previews.

Modern samesite cookie behavior in WebView-WebView complies with chrome and other browserschange, a new samesite cookie behavior is added to provide additional security and privacy, allowing users to have more transparency and control over the cross site use of cookies. Please visitOfficial documentsLearn more.

Restrict use of netlink mac-We will continue to help developers migrate toResettable identifier for privacy protection。 In order to simplify the migration of device level netlink MAC in multiple releases, we limited this function to API level 30 in Android 11. In Android 12, we will impose this restriction on all applications regardless of the target SDK level. Please visitOfficial documentsLearn more.

Export components more securely-To prevent applications from accidentally exporting activities, services, and receivers, we changedandroid:exportedProperty to make it more explicit. With this change, components that declare one or more intent filters must now explicitly declare an Android: exported attribute. You should check the components in the manifest file to avoid installation errors associated with this change. Please visitOfficial documentsLearn more.

More secure handling of intent-In order to make the processing of pendingintents more secure, Android 12 requires the application to explicitly declare a variability flag for each pendingintent, that isFLAG_MUTABLEOr newFLAG_IMMUTABLE。 Please visitOfficial documentsLearn more.

addedPrivacy and security changes.

Better user experience tools

In Android 12, we continue to invest resources in key areas of improving experience and performance. The following are some of the current developments.

Compatible media transcoding-With the popularity of hevc hardware encoder in mobile devices, camera applications are mostly shooting in hevc format. Compared with the old codec, hevc has obvious improvement in quality and compression. Most applications should support hevc, but for applications that cannot support hevc, we have introduced compatible media transcoding.

With this function, applications that do not support hevc can enable the platform to automatically transcode files to a widely compatible AVC format. The transcoding process takes some time, depending on the content of the video and the hardware properties of the device. For example, it takes about 9 seconds to transcode 30fps one minute 1080p video on pixel 4. You can choose to use transcoding service by declaring a media format that the application does not support. We strongly recommend that developers make the application support hevc. If not, enable compatible media transcoding. This feature will be enabled on all devices that use hevc format for video capture. We would like to hear your feedback on this feature. Please visitOfficial documentsLearn more.

Avif image support-Android 12 introducesAV1 image file format)(avif) platform support, providing higher image quality and more efficient compression. Avif is a useAV1Container format for encoded images and image sequences. Like other modern image formats, avif uses the intra coding content of video compression. Compared with the old image format (such as JPEG), avif can greatly improve the image quality under the same file size.

Android 12 first developer PreviewAndroid 12 first developer Preview

△ above figure: avif (18.2kb); Below: JPEG (20.7kb)
Source:《Avif has arrived》MediumImage contrastBy Jake Archibald

Front desk service optimization-Foreground service is an important way of application management for some user oriented tasks, but excessive use will affect the performance and even cause the application to be terminated by the system. In order to ensure that users get a better experience, we will prevent the foreground service from starting from the background for applications targeting the new platform. To help you get rid of this practice more easily, we have introduced a new method in jobschedulerExpedited job), the job has high process priority and network access rights, and runs immediately without being affected by power consumption constraints such as battery saver or doze. In order to achieve downward compatibility, we also integrated the expediting job into the latest version of theJetpack workmanager LibraryYes. In addition, in order to reduce the interference to users, we now delay the display of some foreground service notifications by up to 10 seconds. This gives short-lived tasks the opportunity to complete before the notification is displayed. Please visitOfficial documentsLearn more.

Rich content insertion-Users like to watch images, videos and other expressive content, but it is not always easy to insert and move these content in the application. To enable your application to quickly receive rich content, we have introduced a new unified API that allows you to accept content from any source: clipboard, keyboard or drag and drop. You can add the new interfaceOnReceiveContentListenerAttach to the interface component and get a callback when inserting content through any mechanism. This callback will be the only place where the code processes all content inserts, from plain and styled text to tags, images, video, audio files, and so on. In order to achieve downward compatibility, we have added a unified APIAndroidX。 Please visitOfficial documentsLearn more.

Audio coupled haptic effect-In Android 12, the application can provide audio coupled tactile feedback through the vibration unit of the mobile phone. The vibration intensity and frequency come from the audio session, allowing you to create a more immersive game and audio experience. For example, the video call app can use custom ringtones to identify callers through tactile feedback, and you can simulate rugged terrain in a racing game. Please visitOfficial documentsLearn more.

multi-channel audio -Android 12 brings a number of enhancements to audio containing spatial information. The playback support for mpeg-h passthrough and offload modes is added. The audio mixer, resampler and effect are optimized to support up to 24 channels (only 8 channels were supported in the past).

Improvement of immersive mode API for gesture navigation-We have simplified the immersion mode to make gesture navigation simpler and more coherent in a variety of scenes, such as watching videos, reading books or playing games. In the game related full screen experience, we will stillProtect apps from unexpected gesturesHowever, in all other full screen or immersive experiences (such as video player, reading, Atlas), for applications for the new platform, we will change the default settings to allow users to navigate through a single slide. Please visitOfficial documentsLearn more.

Notification interface update-We revised the notice design to make it more modern, easier to use and more practical. In the first preview, you can see changes from the drawer navigation bar and controls to the template itself. We also optimized the transition and animation of the whole system to make it more smooth. As part of the update, for applications for Android 12, we will beautify notifications with custom content, icons and expansion tips to make them look and feel consistent with other notifications. Please visitOfficial documentsLearn more.

Faster, more sensitive notifications-When users click the notification, they expect to jump to the application immediately. The faster, the better. To meet this expectation, developers need to ensure that the click notification should directly trigger the activation of the activity, rather than using the “trampoline” (through the broadcast receiver or service) to start the activity. Notifying trampoline will cause significant delay and affect the user experience. In order to maintain the response speed of the notification, Android 12 will prevent the notification trampoline from starting the target activity. We also require developers to stop using this practice mode. This change applies only to apps for the new platform, but for all apps, we will display a message box so that you and users can see the trampoline. Please visitOfficial documentsLearn more.

Improved binder IPC call-In terms of improving performance, we focus on how to reduce system variability. After in-depth observation of latency and workload distribution, we made optimization to reduce the median experience at the end (or 99% of use cases). During this period, we purposely improved the system binding calls, increased the lightweight cache strategy, and focused on eliminating lock contention to improve the delay distribution. In this way, the overall performance of binder calls is improved by about 2 times, and the performance of specific calls is significantly improved, such as 47 times for refcontentprovider(), 15 times for releasewakelock(), and 7.9 times for jobscheduler. Schedule().

application compatibility

When releasing a new platform version, we give priority to application compatibility to make the experience of system update faster and smoother. In Android 12, most application-oriented changes are optional so that you have more time to adapt. We have also updated tools and processes to help you get ready faster. We have also added new features to the Google play system update to provide a better running environment for your applications on Android 12 devices.

More Android updates via Google play-We will continue to expand our understanding ofGoogle play system update(project mainline) to create a more consistent and safer environment for applications on various equipment. Android 12 adds an Android runtime (Art) module, which supports pushing updates to the core runtime and Library of Android 12 devices. We can improve runtime performance and correctness, manage memory more effectively, and make kotlin operate faster – all of which no longer require complete system updates. We also extend the functionality of existing modules. For example, we provide compatible media transcoding in an updatable module.

Optimization for tablets, foldable devices, and TVs-As more and more people begin to use applications on large screen devices such as foldable devices, tablets and TVs, now is a good time to ensure that your applications or games are ready for these devices. You canOptimized for tabletsandBuilding applications for foldable devicesStart. Meanwhile, for the largest screen in the family, the first Android 12 preview version for Android TV has also been launched. You can not only bring the latest Android features to TV through this preview, but also test your application in the new Google TV environment. Please goAndroid TV developer websiteLearn more and useAdt-3 Developer KitGet started.

Non SDK interface list update-We added restrictedNon SDK interface, as usual, we look forward to your feedback and welcome youPut forward the requirement of public API

Easier testing and debugging for changes-To make it easier for you to test optional changes that affect your application, we have set many changes to be switchable. You can force these changes to be enabled or disabled one by one through these switches in the developer options or ADB. Please visitOfficial documentsLearn more.

Android 12 first developer Preview

△ application compatibility switch in developer options

Platform stability milestone-As last year, we will inform our platform stability milestones in advance to give you more time to plan application compatibility. At this milestone, we will lock not only the final SDK / NDK API, but also the final internal API and application-oriented system behavior. We expect to reach the platform stability milestone in August 2021. This will give you a few weeks for final testing before the official release. The release schedule is detailed in:https://developer.android.google.cn/about/versions/12/overview

Start experiencing Android 12 now

Whether you want to experience Android 12 features, test applications, orSubmit feedback, you can start with this developer preview. Simply image the device to the systemDownload and swipe in Pixel 3 / 3 XLPixel 3a / 3a XLPixel 4 / 4 XLPixel 4a / 4a 5GorPixel 5The device can be used immediately. If you do not have a pixel device, you can brush the 64 bit system image into the Android emulator in Android studio for use.

set upWhen finished, you can:

  • Experience new features and APIs-In the early stages of the developer preview, your feedback is crucial. You can report problems on our tracking page or go toFeedback and demandPage to provide direct feedback through questionnaires with specific functions.
  • Test the compatibility of your existing applications-This is to see if your application is affected by the default behavior change in Android 12. You just need to install the currently released application on the device or simulator running Android 12 and start testing.
  • Test your application with optional changes-Android 12 has optional behavior changes that will only affect your application when it targets the new platform. It is important to understand and evaluate these changes as early as possible. For easier testing, you canEnable or disable these changes individually

We will regularly update the preview system image and SDK throughout the Android 12 release cycle. Initial preview of this releaseFor developers only, not for daily or consumer use, so weManual download only。 You can swipe the system image into the pixel device or load the OTA image on the device running Android 11. In the latter case, you don’t even need to unlock the bootloader or erase the data. Either way, after manually installing the preview version, you will be able to automatically obtain all future preview and beta updates wirelessly. Please visitOfficial documentsLearn more.

When we approach the final product, we will also invite consumers to try it out, and Android beta registration will be open at that time. Please pay attention to the follow-up information, butCurrently, Android 12 is not available in beta

For complete information about this release, please visitAndroid 12 developer website