2
头图

Author / Dave Burke, VP of Engineering

Last month, we released the first developer preview of Android 13. Android 13 is built around our core themes of privacy and security, developer productivity, and support for tablets and -screen . Today, we're bringing you Android 13 Developer Preview 2, with even more new features and changes to try in your app. Your comments will help us make Android a more suitable platform for developers and users. We welcome you to share test feedback with us!

Ahead of today's release, the Android 12L feature update, which was released to the Android Open Source Project (AOSP) last week, will help you get the most out of over 250 million large-screen Android devices. To help you learn more about Android 13, tablets, and the developer productivity features we offer in Jetpack Compose , we've prepared a new episode of #TheAndroidShow, Click here to watch.

Android 12L feature update, now added to AOSP

Before we get into this developer preview, let's recap last week's news: We've officially released the Android 12L feature update to AOSP, and it's rolling out to all supported Pixel devices in the coming weeks. Android 12L optimizes the Android 12 experience on tablets, including updates such as the ability for users to drag and drop apps into split-screen mode in the new taskbar, new large-screen layouts in the notification shade and lock screen, and Improved app compatibility mode. You can read release blog post for more information.

With Android 12L on schedule for tablet and foldable devices from Samsung, Lenovo, and Microsoft starting later this year, it's time to get your apps ready. We strongly recommend that you test apps in split-screen mode with different sized windows, as well as for different screen orientations, and check for new compatibility mode changes (if applicable). Please visit official document to learn more about the development of Android 12L.

Bottom line: Android 12L's big-screen capabilities are also one of the foundations of Android 13, so you can develop and test on Android 13 because Android 13 reaches the tablet audience running Android 12L. We see big screens as one of the key directions for the future of Android, and we'll continue to invest resources to give you more tools to help you build great experiences for tablets, Chromebooks, and foldables. You can learn more about how to get started big screens through the official documentation, and check out our big screen developer resource .

Let's take a deep dive into what's new in today's Android 13 Developer Preview 2.

and User

People want trusted operating systems and applications for their most private and sensitive information and on-device resources. Privacy and user trust are at the heart of the Android Product Principles. In Android 13, we'll continue to focus on delivering a more secure environment on devices and giving users more control to create a responsible, high-quality platform for everyone. Here's what's new in Developer Preview 2.

Notification permission - To help users focus on the notifications that matter most to them, Android 13 introduces a new runtime permission : POST_NOTIFICATIONS for sending notifications from apps. Apps targeting Android 13 now need to request notification permissions from the user before sending notifications. Apps targeting Android 12 or lower will handle the upgrade process on your behalf. We will continue to optimize this process. To give your users more context and control, we encourage you to target Android 13 as early as possible and request notification permissions in your app. Please visit official document for details.

△ Android 13 中的通知权限对话框

△ Notification permission dialog in Android 13

Developer Downgradable Permission - Some apps may no longer require certain permissions previously granted by the user to enable a specific feature or preserve sensitive permissions in older Android versions. In Android 13, we've provided a new API ) that lets your app protect user privacy by downgrading previously granted runtime permissions.

Safer export of context-registered receivers - In Android 12, we require developers to declare exportability for intent receivers declared in the app manifest. In Android 13, we require you to do the same thing for context-registered sinks as well: when registering sinks for non-system sources, add RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flags to them. This will help ensure that the receiver will not be broadcast by other applications unless it is intentional. While this isn't mandated in Android 13, we recommend that you declare exportability as the first step in securing your app.

In Android 13, we're working hard to give you more tools to help you provide users with a more refined experience and better performance. Here are some of the updates in today's developer preview.

Japanese text wrapping improvements - TextView can now wrap text by words (sections/bunsetsu, the smallest semantic unit that sounds natural) or phrases, rather than by characters. This makes for a better reading experience for Japanese apps. You can enable this kind of line breaking by using android:lineBreakWordStyle="phrase" in the TextView:

△ 不启用 (上) 和启用 (下) 短语折行的日语文本对比

△ Comparison of Japanese text without (top) and with (bottom) phrase wrapping enabled

Improves line height for non-Latin scripts - Android 13 improves the display of non-Latin scripts such as Tamil, Burmese, Telugu, and Tibetan with a line height appropriate for each language. The new line height prevents clipping and improves character positioning. Your app only needs to target Android 13 to get these improvements. Please be sure to test your app with the new line spacing, as changes may affect non-Latin-based UIs.

△ 以 Android 13 为目标平台的应用中的非拉丁文字行高改进效果 (下)

△ Improvement of non-Latin text line height in apps targeting Android 13 (bottom)

Text Conversion API - Users of languages such as Japanese and Chinese use the Pinyin input method, which tends to slow down features such as search and auto-completion. In Android 13, apps can call the new text conversion API , making it faster and easier for users to find what they need. For example, previous searches required Japanese users (1) to enter hiragana to represent the pronunciation of the search term, which could be a place name or an app name (2) use the keyboard to convert hiragana characters to kanji (3) re-search using kanji characters ( 4) Get search results. With the help of the new text conversion API, Japanese users can immediately see kanji search results by simply typing in hiragana, skipping steps 2 and 3.

Color Vector Font - Android 13 adds rendering support for COLR version 1 (please refer to detailed specs and intro video ) fonts 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 applications, this modification is completely imperceptible and the system handles everything automatically. Starting with Developer Preview 2, you can choose to use COLRv1 in your app. If your app implements its own text rendering and uses system fonts, we recommend that you use COLRv1 and test the rendering of emoji. You can learn more about COLRv1 in Chrome release bulletin .

△ COLRv1 矢量表情符号 (左) 和位图表情符号

△ COLRv1 vector emoji (left) and bitmap emoji

Bluetooth Low Energy (LE) Audio - Low Energy (LE) Audio is the next generation of wireless audio that replaces classic Bluetooth and enables new use cases and connectivity topologies. It allows users to share and broadcast their own audio with friends and family, or subscribe to public radio for information, entertainment or accessibility assistance. It's designed to ensure users can receive high-fidelity audio and switch seamlessly between different use cases without sacrificing battery life, something classic Bluetooth can't do. Android 13 adds built-in support for low-power audio, so developers don't have to do anything to get this new feature on compatible devices.

MIDI 2.0 - Android 13 adds support for the new MIDI 2.0 standard, including the ability to connect 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 with single-note controllers.

Application Compatibility

When releasing new platform versions, we prioritize app compatibility to make the system update experience faster and smoother. In Android 13, app-facing changes are optional to give you more time to adjust and adapt, and we've updated tools and processes to help you get ready faster.

With the arrival of Developer Preview 2, we've been able to go one step further in the Android 13 release journey and continue to improve overall stability, so it's time to try out new features and changes, and give us your feedback. We'd especially like to get feedback on the API and your application. Welcome to feedback page to share your thoughts or report issues with us.

Now you can also start compatibility testing and determine what needs to be done next. We recommend that you schedule these efforts as early as possible so that compatible updates are released when Android 13 Beta 1 rolls out. There is currently no need to change the targetSdkVersion of the app, but we recommend using the behavior change switch in the developer options to get a first look at the impact of the optional changes in Android 13 on the app.

We will reach platform stability milestone in June 2022, when all app-facing system behaviors, SDK/NDK APIs, and non-SDK manifests will be finalized. At that point, you can complete final compatibility testing and release a fully compliant app, SDK, or development library. See release schedule for details.

△ 开发者选项中的应用兼容性开关

△ App compatibility switch in developer options

started with Android 13

Whether you want to experience Android 13 features, test apps, or , you can start with this developer preview. Just download and flash the system image to the Pixel 6 Pro / 6 / 5a 5G / 5 / 4a (5G) / 4a / 4 XL / 4 device and you are ready to go. If you don't have a Pixel device, you can use the Android emulator with a 64-bit system image in Android Studio Dolphin. For more extensive testing, we also provide GSI images. If you've already installed the last preview build on your Pixel device, you'll get updates automatically via OTA, including future preview and beta builds. Please visit official document for details.

For complete information on this release, visit Android 13 developer site .

You are welcome here to submit feedback to us, or share your favorite content and found problems. Your feedback is very important to us, thank you for your support!


Android开发者
404 声望2k 粉丝

Android 最新开发技术更新,包括 Kotlin、Android Studio、Jetpack 和 Android 最新系统技术特性分享。更多内容,请关注 官方 Android 开发者文档。