Platform Stability Milestone | Android 14 Beta 3 Released

作者 / Dave Burke, VP of Engineering

With today's release of Android 14 Beta 3, we enter the next phase of the Android development cycle. Beta 3 remains built around our core themes of privacy, security, performance, developer productivity, and user customization, while continuing to refine the experience on larger-screen devices like tablets and foldables.

1dafa6e4a6c8a160f185a1ff1aeb66a6.png

Beta 3 also allows Android 14 to reach the platform stability milestone, which means that the developer API and all application-oriented behaviors have been finalized for everyone to evaluate and integrate into their own applications. Thank you for sharing your valuable opinions and feedback with us along the way. It is everyone who helped us reach this milestone smoothly.

  • Platform Stability Milestone
    https://developer.android.google.cn/about/versions/14/overview#platform_stability

Android 14 has a lot to try and explore in your own apps. The same is true for today's Beta 3, where we'll highlight new accessibility features (such as non-linear font zoom), privacy updates (including partial access to photos/videos), new gesture navigation animations, and integration with OpenJDK 17 Features further aligned with LTS releases.

  • Non-linear font scaling
    https://developer.android.google.cn/about/versions/14/features#non-linear-font-scaling

  • Grant partial access to photos and videos
    https://developer.android.google.cn/about/versions/14/changes/partial-photo-video-access

  • Support built-in and custom predictive back animation
    https://developer.android.google.cn/about/versions/14/features/predictive-back

  • OpenJDK 17 update
    https://developer.android.google.cn/about/versions/14/features#core

e10c10eae3c4d4a909b58a3bbda36e45.png

Platform Stability Milestones

With Beta 3 and platform stability milestones approaching, you can confidently develop and release necessary compatibility updates. Please begin final compatibility testing now and prepare to release any necessary updates to gain valuable feedback during the remainder of the beta testing period. All of this work will help you create a smooth app experience ahead of Android 14's official launch later this year.

95bdd430e5a6c22afb71d2f1abc3c6b1.png

  • Platform Stability Milestone
    https://developer.android.google.cn/about/versions/14/overview#platform_stability

If you are a developer of SDKs, development libraries, tools, and game engines, it is even more important to start testing immediately and release compatibility updates as soon as possible: before getting updates from you, your downstream application and game developers' work may be broken. Blocked due to compatibility issues. So be sure to let your downstream developers know when compatibility updates are released!

02ed6230f10422c2fdb0491c873066d3.png

app compatibility

With each release of Android, we make overall improvements to the platform to enhance privacy and security, and to optimize the user experience across the operating system. These can all affect your application. To test app compatibility, simply install your production app from Google Play or another source on a device running Android 14 Beta 3. Please test all flows of your app to find issues exposed in functionality or UI. Please use the behavior change checklist (for all apps) to prioritize testing:

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

Here are some changes to be aware of:

Non-linear font enlargement

Starting from Android 14, the system supports font enlargement to 200% by default. This change provides richer accessibility options for low-vision users that comply with Web Content Accessibility Guidelines (WCAG). Please run UI testing with the maximum text size (200%) enabled to ensure that your app can accommodate larger text sizes without impacting usability. To better fit this function, please also make sure you don't hard-code the calculation of sp in Configuration or DisplayMetrics, and convert between sp and px via applyDimension() and deriveDimension() of TypedValue.

  • Non-linear font scaling
    https://developer.android.google.cn/about/versions/14/behavior-changes-all#non-linear-font-scaling

  • Web Content Accessibility Guidelines (WCAG)
    https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-scale.html

  • Use non-linear font scaling to test the application
    https://developer.android.google.cn/about/versions/14/features#test-scaling

  • Configuration
    https://developer.android.google.cn/reference/android/content/res/Configuration

  • DisplayMetrics
    https://developer.android.google.cn/reference/android/util/DisplayMetrics

  • TypedValue
    https://developer.android.google.cn/reference/android/util/TypedValue

  • applyDimension()
    https://developer.android.google.cn/reference/android/util/TypedValue#applyDimension(int,%20float,%20android.util.DisplayMetrics)

  • deriveDimension()
    https://developer.android.google.cn/reference/android/util/TypedValue#deriveDimension(int,%20float,%20android.util.DisplayMetrics)

Grant partial access to photos and videos

When your app requests any visual media permission (READ_MEDIA_IMAGES or READ_MEDIA_VIDEO, introduced in Android 13, API 33), the user can grant only partial access to the media library. When your app switches to the background, or when the user actively kills your app, the system treats these partial access permissions as a single authorization, and then finally turns off these permissions. If your app follows best practices for this type of authorization, this change will have no impact. Android 14 introduces the READ_MEDIA_VISUAL_USER_SELECTED permission to help apps better support these changes. We recommend that you consider using the photo picker to provide users with a safe way for the app to specify access to certain photos and videos, so that there is no need to apply for permissions, and the experience is smoother.

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

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

  • Grant partial access to photos and videos
    https://developer.android.google.cn/about/versions/14/changes/partial-photo-video-access

  • Best Practices
    https://developer.android.google.cn/about/versions/14/changes/partial-photo-video-access#best-practices

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

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

Data security messages are more prominent

In order to better protect user privacy, Android 14 adds some places in the system to display the information you declare in the form of the Play Console. For some permissions, we've added a clickable section to the runtime permissions dialog to further demonstrate the app's data sharing. This part of the system dialog displays information such as why your app needs to share data with third parties, and provides users with jump links to manage your app's data access settings. We recommend that you review your app's location data sharing policy and update your app's declaration in the Google Play Data Security section accordingly.

  • More prominent data security information
    https://developer.android.google.cn/about/versions/14/changes/data-safety

  • Provides information for the data security section of Google Play
    https://support.google.com/googleplay/android-developer/answer/10787469

Please use the Behavior Changes Checklist for any changes that may affect the compatibility of your app or game. If you find compatibility issues with an app's development library or SDK, please update them to the latest version, or contact its developer for assistance.

  • Behavior changes (all apps)
    https://developer.android.google.cn/about/versions/14/behavior-changes-all

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 14) and use the compatibility framework tools to quickly detect issues.

  • Update the app's target platform and build with the new API
    https://developer.android.google.cn/preview/migration#setup_sdk

  • Comply with Google Play's target API level requirements
    https://developer.android.google.cn/distribute/best-practices/develop/target-sdk

  • Behavior changes (apps targeting Android 14 or higher)
    https://developer.android.google.cn/about/versions/14/behavior-changes-14

  • Compatibility framework tools
    https://developer.android.google.cn/guide/app-compatibility/test-debug

Some changes that need attention are listed below (applicable to applications whose targetSdkVersion is API 34 or higher):

Must provide foreground service type

If your app targets Android 14, you must specify at least one foreground service type for each foreground service in your app. Be sure to choose a foreground service type that represents the actual use case of your app. The system checks that you have selected the correct foreground service type and that the app correctly requests runtime permissions or uses the required APIs. For example, if the foreground service type of the application is FOREGROUND_SERVICE_TYPE_LOCATION, the system will consider that it needs to apply for the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission. Android 14 adds corresponding foreground service types for health and remote messaging scenarios, and also reserves new types for short-term services, special purposes, and system exemptions. If a scenario in your application does not match these types, we strongly recommend that you migrate this part of the logic to use WorkManager or user-initiated data transfer jobs.

  • Foreground services
    https://developer.android.google.cn/guide/components/foreground-services

  • Foreground service type is required
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required

  • FOREGROUND_SERVICE_TYPE_LOCATION
    https://developer.android.google.cn/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_LOCATION

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

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

  • Health
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required#health

  • Remote Messaging
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required#remote-messaging

  • Short service
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required#short-service

  • Special use
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required#special-use

  • System exemption
    https://developer.android.google.cn/about/versions/14/changes/fgs-types-required#system-exempted

  • Use WorkManager to schedule tasks
    https://developer.android.google.cn/topic/libraries/architecture/workmanager

  • Data transfer jobs initiated by users
    https://developer.android.google.cn/about/versions/14/changes/user-initiated-data-transfers

OpenJDK 17 update

Some changes in Android 14 are aimed at aligning the core library with the latest OpenJDK LTS version features. These changes may affect the compatibility of your application, including regular expressions, UUID handling, issues involving ProGuard, and the addition of java. lang. ClassValue.

  • OpenJDK 17 update
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#core-libraries

  • java.lang.ClassValue
    https://developer.android.google.cn/reference/java/lang/ClassValue

security changes

Apps targeting Android 14 can no longer send certain implicit intents to internal components. Broadcast receivers registered at runtime must specify an exported behavior, unless they only receive system broadcasts. Dynamically loaded code files must be marked as read-only. ZipFile(String) and ZipInputStream.getNextEntry() throw ZipException if the zip filename contains ".." or starts with "/", to avoid triggering the zip path traversal vulnerability. Starting an Activity from the background now has additional restrictions, and there are newer restrictions on calling non-SDK interfaces.

  • Security changes
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#security

  • Restrictions on implicit intents and pending intents
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#safer-intents

  • Broadcast receivers registered at runtime must specify export behavior
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#runtime-receivers-exported

  • Exception for receivers that only receive system broadcasts
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#system-broadcasts

  • Safer dynamic code loading
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#safer-dynamic-code-loading

  • ZipFile(String)
    https://developer.android.google.cn/reference/java/util/zip/ZipFile#public-constructors

  • ZipInputStream.getNextEntry()
    https://developer.android.google.cn/reference/java/util/zip/ZipInputStream#getNextEntry%28%29

  • ZipException
    https://developer.android.google.cn/reference/java/util/zip/ZipException

  • Compressed path traversal
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#zip-path-traversal

  • Other restrictions on launching Activity from the background
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#background-activity-restrictions

  • Updated non-SDK restrictions
    https://developer.android.google.cn/about/versions/14/behavior-changes-14#non-sdk-restrictions

99b2bc1fdf7c0db2c0ff8f9ddc22eb3c.png

Experience Android 14 Now

Whether you want to experience the features of Android 14, test apps or submit feedback, you can start with this Beta 3. You can also use our partners' devices to test your app's performance on tablets and foldables, but the easiest way is to use the Android Studio SDK Manager in the latest preview version of the Android emulator with a 64-bit system image installed The Pixel Tablet or Pixel Fold configuration for testing. You can also directly use supported Pixel devices (including the latest Pixel 7a) to participate in the test, and get this and future Android 14 Beta versions (including feature updates) through OTA.

  • Feedback and Demand

    https://developer.android.google.cn/about/versions/14/feedback

  • Install the SDK

    https://developer.android.google.cn/about/versions/14/setup-sdk#install-sdk

  • Participate in beta testing
    https://www.google.com/android/beta

For the best Android 14 development experience, we recommend using the latest version of Android Studio Hedgehog.

  • Android Studio Hedgehog
    https://developer.android.google.cn/studio/preview

After setting up the SDK, you can:

  • Experiment with new features and APIs - everyone is welcome to continue reporting issues on our tracking page.

  • Test your app for compatibility - Test whether your app is affected by Android 14 default behavior changes. Please install the app on a device or emulator running Android 14 to test it thoroughly.

  • Test your app with optional changes - Android 14 provides optional behavior changes that only affect if your app targets the new platform. It is important to understand and evaluate these changes early on. For testing purposes, you can enable or disable these changes individually.

  • Set up the Android 14 SDK

    https://developer.android.google.cn/about/versions/14/setup-sdk

  • Compatibility Framework Changes (Android 14)
    https://developer.android.google.cn/about/versions/14/reference/compat-framework-changes

We'll be regularly updating beta system images throughout the Android 14 release cycle.

If you have already participated in the Android 14 Beta test and your device supports it, you will get this Beta 3 directly through the OTA update without additional operations:

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

Please visit the Android 14 developer site for details on how to get the beta:

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

You are welcome to click "Send Message" at the end of the article to submit your feedback on Android 14 to us, or share your opinions, suggestions, and what you want to see on the "Android Developer" official account.

We will randomly select 5 WeChat fans who send messages to send a set of developer gifts.

8e281f2552ef2a6eac68a8a79d4c13cb.jpeg

29358827502e5228b5a4ebbf6c5674cd.png

6b77cfe7f362b3428b6721acf28d8d7e.png

*Developer Gifts: Android Candy Pen, Google Play Candy Pen, Android Camera Cover, Android Stickers .

* Winners are limited to WeChat fans who send messages to "Android Developer".

* The same WeChat user cannot win the prize repeatedly in this event.

* We will contact the award-winning friends through private messages, please pay attention to WeChat news at that time.

* Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

10970f588fd80eadece391ab0e9d977b.gif

recommended reading

If the page does not load, please refresh and try again

d8df214f7542cb10e5f3b699938b3144.gif Click at the end of the screen read the original text  | learn more about Android 14 detailed update  


a0b0114500ddabeb8466aff0ae9636e5.png

Guess you like

Origin blog.csdn.net/m0_57546986/article/details/131199109