Android 13 is now official, check out what's new!

The source code of Android 13  was pushed to the Android Open Source Project (AOSP), and the latest version of Android was officially released. For developers, Android 13 focuses on our core themes of privacy and security, as well as developer productivity, making it easier for you to build great experiences for your users. Optimizations have also been made to make Android a better operating system for tablets and larger-screen devices .

  • Android Open Source Project

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

  • Responsive layout for large screen device development

    https://developer.android.google.cn/large-screens

Android 13 is rolling out to Pixel devices starting today. Android 13 will also be rolled out gradually to other your favorite devices, including Samsung Galaxy, ASUS, HMD (Nokia phones), iQOO, Motorola, OnePlus, OPPO, Realme, Sharp, Sony, TECNO, vivo, Xiaomi and more.

What does Android 13 bring to developers?

There are many updates brought by Android 13, and the following is just a selection. Be sure to head over to the Android 13 developer site for details on all the new features:

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

Developer Productivity and Tools

Themed app icons  - Android 13 extends Material You's dynamic colors to all app icons, allowing users to choose icon tints based on their wallpaper and other theme preferences. Your app only needs to provide a monochrome app icon with some adjustments to the adaptive icon XML. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/features#themed-app-icons

△ The theme application icon that changes the color tone based on the wallpaper color and dark theme (left)

  • Icon Specifications

    https://developer.android.google.cn/guide/practices/ui_guidelines/icon_design_adaptive#design-adaptive-icons

Set language preference by application  - Android 13 can make applications use other languages ​​than the system language to better meet the needs of multilingual users. Android now provides apps with a standard "App Language" settings panel (if the app chooses to support this feature), and you can also call a new platform API to get or set the user's preferred locale at runtime, reducing boilerplate code and improve compatibility. Please visit the official documentation for details:

https://developer.android.google.cn/guide/topics/resources/app-languages

△ Single app language option in settings

  • Add supported languages ​​to phone settings using android:localeConfig

    https://developer.android.google.cn/guide/topics/resources/app-languages#use-localeconfig

  • LocaleManager

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

Improved text support  - Android 13 offers several improvements for text and language to help you create a better experience. Faster Hyphenation optimizes hyphenation performance by up to 200%, so you can now enable this feature in TextView with almost no impact on rendering performance. By using the text conversion API, languages ​​such as Chinese and Japanese that require pinyin input can perform functions such as search and auto-completion faster. Android 13 also improves the line height of non-Latin scripts (such as Tamil, Burmese, Telugu, and Tibetan) to keep characters from being cut and easier to read. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/features#language-support

△ Improvement effect of non-Latin text line height in applications targeting Android 13 (below)

  • faster hyphenation

    https://developer.android.google.cn/about/versions/13/features#faster-hyphenation

  • Text Conversion API

    https://developer.android.google.cn/about/versions/13/features#text-conversion

  • Improved line height for non-latin letters

    https://developer.android.google.cn/about/versions/13/features#line-height

Color vector fonts  - Android 13 adds support for COLR version 1 (please refer to detailed specifications and introduction video) font rendering support, and updates system emoji to COLRv1 format. COLRv1 is a new, highly compact font format that renders quickly and clearly at any size. For most apps, this modification is completely unnoticeable and the system takes care of everything automatically. You can learn more about COLRv1 in the Chrome release announcement:

https://developer.chrome.com/blog/colrv1-fonts/

△ COLRv1 vector emoji (left) and bitmap emoji

  • COLR Specifications

    https://docs.microsoft.com/en-us/typography/opentype/spec/colr

  • COLR Introduction Video

    https://www.youtube.com/watch?v=BmqYm5Wwz8M

Quick Settings Placement API  - For apps that offer custom Quick Settings tiles, Android 13 makes it easier for users to discover and add your tiles. With the new tile placement API, your app can now let users add your custom quick settings tiles directly through a dialog, all in one step, without leaving your app. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/features#quick-settings

  • TileService

    https://developer.android.google.cn/reference/android/service/quicksettings/TileService

  • Tile placement API

    https://developer.android.google.cn/reference/android/app/StatusBarManager#requestAddTileService(android.content.ComponentName,%20java.lang.CharSequence,%20android.graphics.drawable.Icon,%20java.util.concurrent.Executor,%20java.util.function.Consumer%3Cjava.lang.Integer%3E)

Programmable shaders  - Android 13 introduces programmable RuntimeShader objects whose behavior is defined using the Android Graphics Shading Language (AGSL). You can use these shaders to implement moiré, blur, overscroll stretching, and similar advanced effects in your own applications. Please visit the official documentation for details:

https://developer.android.google.cn/guide/topics/graphics/agsl

  • RuntimeShader

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

  • Android Graphics Shading Language

    https://developer.android.google.cn/guide/topics/graphics/agsl

  • Ripple

    https://cs.android.com/android/platform/superproject/+/master:frameworks/base/graphics/java/android/graphics/drawable/RippleShader.java;l=24?q=RippleShader&sq=

  • Blur

    https://cs.android.com/android/platform/superproject/+/master:frameworks/native/libs/renderengine/skia/filters/BlurFilter.cpp?q=RuntimeShader&ss=android%2Fplatform%2Fsuperproject&start=21

  • Excessive rolling stretch (Stretch)

    https://cs.android.com/android/platform/superproject/+/master:frameworks/base/tests/HwAccelerationTest/src/com/android/test/hwui/StretchShaderActivity.java?q=RuntimeShader&ss=android%2Fplatform%2Fsuperproject&start=11

PlaybackState-based media controls  - For apps targeting Android 13, the system implements richer media controls based on the PlaybackState action manifest for better consistency across device types such as phones and tablets, and compatibility with Android Auto Consistent with other Android platforms such as Android TV. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/behavior-changes-13#playback-controls

△ Android 13 media controls are consistent on phones and tablets

  • PlaybackState

    https://developer.android.google.cn/reference/android/media/session/PlaybackState

Bluetooth Low Energy (LE) Audio  - Low Energy (LE) audio is the next generation of wireless audio enabling new use cases. It allows users to share and broadcast their audio with friends and family, or subscribe to public radio for information, entertainment or accessibility assistance. It is designed to ensure users can receive high-fidelity audio without sacrificing battery life, and seamlessly switch between different use cases. Android 13 adds built-in support for low-power audio, and developers can use this new feature on compatible devices. Please visit the official documentation for details:

https://developer.android.google.cn/reference/android/bluetooth/BluetoothLeAudio

  • Low Energy (LE) Audio
    https://www.bluetooth.com/learn-about-bluetooth/recent-enhancements/le-audio/resources/

MIDI 2.0  - Android 13 adds support for the new MIDI 2.0 standard, including the ability to connect to MIDI 2.0 hardware via USB. This updated standard offers new features such as higher controller resolution, better support for non-Western tones, and better expressiveness through single-note controllers. Please visit the official documentation for details:

https://developer.android.google.cn/reference/android/media/midi/MidiDeviceInfo#PROTOCOL_UMP_MIDI_2_0

  • The new MIDI 2.0 standard
    https://www.midi.org/midi-articles/details-about-midi-2-0-midi-ci-profiles-and-property-exchange

OpenJDK 11 Update  - The Android 13 core library has been aligned with the OpenJDK 11 LTS release, providing application and platform developers with library updates and Java 11 programming language support. As part of the ART module update for Android 12 and above devices, we plan to   release these core library changes to more devices through Google Play system updates. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/features#core-libraries

Predictive Return Gestures  - Android 13 introduces new APIs that allow your app to tell the system that it will handle return events earlier, which we call the "early" model. This new approach, which will take several years to perfect, helps your app support predictive back gestures, which are now available for testing in the current release via developer options. Please visit the official documentation for details:

https://developer.android.google.cn/guide/navigation/predictive-back-gesture

  • Let the system return to the original operation
    https://io.google/2022/program/5c6a8dbb-7ac2-4c31-a707-0a16e8424970/

Made for Tablets

Android 13 builds on  the Android 12L feature update we released earlier this year to deliver an even better experience on tablets. We have enhanced some features, including an improved taskbar for multitasking operations, more layouts for large screens , and many optimizations for the system interface and applications, application compatibility mode has also been improved, and more. We will continue to dedicate resources to building tools for you to help you build great experiences for tablets, Chromebooks, and foldables. You can get started with Getting Started with Big Screen, and be sure to browse through our Big Screen developer resources.

△ Multitasking on a tablet running Android 13

  • Getting Started with Big Screen

    https://developer.android.google.cn/guide/topics/large-screens/get-started-with-large-screens

  • Responsive layout for development on large screen devices

    https://developer.android.google.cn/large-screens

Privacy and Security

Photo Picker and API  - The new system photo picker provides a standard and private way for users to share local and cloud photos. The photo picker extends the long-standing document picker on Android, making it easy for users to share specific photos and videos with apps without giving the app permission to view all media files on the device. The photo picker provides a dedicated experience for photos and videos, and provides an API for apps to access shared media files. Users of Android 11 and above devices (except Go devices) will get the photo picker feature through a Google Play system update. Please visit the official documentation for details:

https://developer.android.google.cn/training/data-storage/shared/photopicker

△ Users can share specific photos and videos to the app through the photo selector

Notification permission  - To help users focus on the notifications that matter most to them, Android 13 introduces a new notification runtime permission. Now the app needs to request notification permission from the user before sending the notification. For apps targeting Android 12 or lower, the upgrade process will be handled on your behalf. Please visit the official documentation for details:

https://developer.android.google.cn/guide/topics/ui/notifiers/notification-permission

△ Notification permission dialog in Android 13

  • POST_NOTIFICATIONS

    https://developer.android.google.cn/reference/android/Manifest.permission#POST_NOTIFICATIONS

Permissions for nearby Wi-Fi devices  - Android 13 introduces a new NEARBY_WIFI_DEVICES runtime permission for apps that manage a device's connections to nearby Wi-Fi hotspots. This new permission is required for many commonly used Wi-Fi APIs, allowing apps to discover and connect to nearby devices over Wi-Fi without requiring location permission. Please visit the official documentation for details:

https://developer.android.google.cn/guide/topics/connectivity/wifi-permissions

  • NEARBY_WIFI_DEVICES

    https://developer.android.google.cn/reference/android/Manifest.permission.html#NEARBY_WIFI_DEVICES

Granular Media Permissions  - The photo picker is now our recommended solution when sharing photos and videos, it's more user-friendly and doesn't require asking for permissions. But for apps that haven't yet used the photo picker, or for scenarios that require access to audio files, Android 13 also adds new, more granular media permissions. These media permissions replace the READ_EXTERNAL_STORAGE permission and allow apps to access certain media file types, including images, video, and audio. We strongly recommend using the photo picker scheme when possible, and granular media permissions when your app targets Android 13 and that's not an option. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/behavior-changes-13#granular-media-permissions

△ Request permission to access audio files

  • photo picker

    https://developer.android.google.cn/training/data-storage/shared/photopicker

  • READ_EXTERNAL_STORAGE

    https://developer.android.google.cn/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE

Developers can downgrade permissions  - Starting with Android 13, if an app no ​​longer requires certain permissions that were previously granted by the user, it can downgrade permissions through a new API. By removing permissions that are no longer used, your app can increase user trust by showing users that it is using only the minimum necessary permissions. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/features#developer-downgradable-permissions

  • revokeOwnPermissionsOnKill

    https://developer.android.google.cn/reference/android/content/Context.html#revokeOwnPermissionsOnKill(java.util.Collection%3Cjava.lang.String%3E)

Safer export intent filters  - Android 13 introduces stricter rules when sending explicit intents to the export intent filters of other apps targeting Android 13. If the intent specifies an action, the system delivers the intent to the exporting component only if the intent matches an <intent-filter> element declared in the receiving application. Please visit the official documentation for details:

https://developer.android.google.cn/about/versions/13/behavior-changes-13#intent-filters

application performance

Android 13 improves the performance and efficiency of all apps with updates to the ART runtime. We are updating the ART module for Android 12 and above devices, and as part of this update, we will also bring these performance improvements to more Android users through Google Play system updates.

Garbage Collection Improvements  - A new garbage collector based on the Linux kernel feature userfaultfd will be coming to ART on Android 13 devices with an upcoming Google Play system update. The new garbage collector eliminates read barriers, reduces the overhead of loading each object, reduces memory pressure, and reduces the size of compiled code by about 10%. It's also more efficient at GC time, since pages are freed as compactions occur. All in all, the new garbage collector helps save power, avoids stuttering during GC, and saves apps from being forced to terminate when low on memory.

Optimizations throughout ART  - In Android 13, ART makes switching to native code and vice versa much faster, with JNI calls now up to 2.5x faster. We also redesigned the reference handling at runtime to be basically non-blocking, which further reduces jank. We've exposed a new public API, Reference.refersTo(), that lets you reclaim unreachable objects as quickly as possible, and we've optimized class/method lookups to make the interpreter run faster. Finally, ART now performs more bytecode verification at install time, avoiding the overhead of verification at runtime, allowing applications to start quickly. Please watch the Application Performance Update Introduction for details:

https://io.google/2022/program/2cf473b7-113e-4332-a469-8dfd815eb45b/

  • Reference.refersTo()

    https://developer.android.google.cn/reference/java/lang/ref/Reference.html#refersTo(T)

Get your application ready!

With  the official release of Android 13  to AOSP today, all Android developers need to complete compatibility testing and release updates as soon as possible , so that your users can transition to Android 13 smoothly.

Just install your app on a device running Android 13 to start testing its compatibility. Please test all flows of your app to find issues exposed in functionality or UI. Please use the Android 13 behavior change checklist (for all apps) to identify changes that may affect your app:

https://developer.android.google.cn/about/versions/13/behavior-changes-all

  • Get Android 13
    https://developer.android.google.cn/about/versions/13/get

Here are some changes to be aware of:

  • Runtime Permissions for Notifications  - Make sure you understand how the new permissions work when your app sends notifications, and start planning for Android 13 (API 33) as soon as possible to provide a positive user experience. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/changes/notification-permission

  • Clipboard preview  - Make sure your app hides sensitive data, like passwords or credit card information, in Android 13's new clipboard preview. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/behavior-changes-all#copy-sensitive-content

  • JobScheduler Prefetch  - JobScheduler now predicts when you'll next launch your app and runs the associated prefetch job ahead of time. If you use prefetch jobs, make sure they work by testing. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/behavior-changes-all#prefetch-job-handling

  • job scheduler

    https://developer.android.google.cn/reference/android/app/job/JobScheduler

Don't forget to test the compatibility of the development libraries and SDK in the application. If you find that there is a problem with the SDK during testing, please try to update the SDK to the latest version, or ask its developer for help.

Once you've published a compatible version of your current app, you can start updating your app's targetSdkVersion. Review the list of behavior changes (for apps targeting Android 13), and use the Compatibility Framework tool to quickly detect issues.

  • Start Updating: Update the app's target platform and build with the new API

    https://developer.android.google.cn/preview/migration#setup_sdk

  • targetSdkVersion: Meets Google Play's target API level requirements

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

  • Behavior Change Checklist: Apps targeting Android 13 or higher

    https://developer.android.google.cn/about/versions/13/behavior-changes-13

  • Compatibility Framework Tools

    https://developer.android.google.cn/guide/app-compatibility/test-debug

Support for tablets and large screen devices

Android 13 brings an even better experience to tablets, so make sure your apps take advantage of it. You can test features related to large-screen devices by setting up the Android emulator in  Android Studio  , or test on large-screen devices from our Android 13 Beta partners.

  • Set up the Android emulator

    https://developer.android.google.cn/about/versions/13/get#on_emulator

  • Android 13 Beta Supported Devices

    https://developer.android.google.cn/about/versions/13/features/large-screens#large-screen-partners

Here are some points to keep in mind when testing:

  • Taskbar Interaction  - Check how your app interacts with the new taskbar on larger screens to make sure that your app's interface isn't clipped or obscured by the taskbar. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/features/large-screens#multitasking

  • Multi-window mode  - Multi-window mode is now enabled by default for all apps, regardless of app configuration, so make sure your app handles split-screen displays properly. You can switch your app to split-screen mode by dragging and dropping, and resize the windows for testing. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/features/large-screens#dev-test-splitscreen

  • Improved Compatibility Experience  - If your app is not optimized for tablets, such as using a fixed orientation, not supporting zoom, etc., please check how your app behaves in compatibility mode (such as letterbox mode). Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/features/large-screens#compatibility

  • Media projection  - If your app uses media projection, check how your app plays media, streams it, and projects it to large screen devices. Don't forget to adapt for state transitions for foldable devices. Please visit the official documentation to learn more:

    https://developer.android.google.cn/about/versions/13/features/large-screens#media-projection

  • Camera Preview  - For camera apps, check how the camera preview interface behaves in multi-window mode or split-screen mode on large-screen devices when the app is restricted to a partial area of ​​the screen. Also don't forget to adapt for state transitions for foldable devices. Please visit the official documentation to learn more:

    https://developer.android.google.cn/training/camera2/camera-preview

Please go to the official website to learn more about Android 13 tablet features and test points:

https://developer.android.google.cn/about/versions/13/features/large-screens

Next step

Android 13 is rolling out to Pixel devices starting today.

If you have already participated in the Android beta test, you will automatically get the official version of Android 13, and will continue to get beta updates for these features in subsequent Android 13 feature updates (released later this year). If you don't want to continue to receive beta updates and don't want to flash your device, just opt ​​out at the Android Beta testing site after you get the official version of Android 13 and before the beta release of the first feature update of Android 13 :

https://www.google.com/android/beta

System images for Pixel devices are available for download and flashing to your device. You can also get the latest Android Emulator system image through Android Studio's SDK Manager. If you need the source code for Android 13, it's available in the Android 13 branch of the Android Open Source Project (AOSP) repo.

  • Android system image

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

  • Android Open Source Project

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

  • Android source code

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

Guess you like

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