Android 14 source code is officially pushed to AOSP, and the official introduction of "key content in the development process"

Android 14 source code is officially pushed to AOSP, and the official introduction of "key content in the development process"

On October 11, according to an article published on the official Google Developers account, the source code of Android 14 has been pushed to the Android Open Source Project (AOSP) .

Android 14 is designed to improve developer productivity while bringing better performance, privacy, security, and customization features to users.

The official also introduced the "most impactful part" of Android 14 on developers, which is summarized as follows:

Performance and efficiency

Officials claim that one of the key areas of focus of Android 14 is to "bring better performance and efficiency to the platform."

Freeze cached applications

Before Android 14, cached apps could run largely unrestricted. In Android 14, the system freezes the app shortly after it enters the cache, and its CPU time drops to zero.

On Android 14 Beta, the relevant cache process consumes 50% less CPU cycles than on Android 13 official version devices.

Therefore, background work outside of the regular Android application lifecycle APIs (such as foreground services, JobScheduler, or WorkManager) is prohibited.

Broadcast Optimization

In order to keep the frozen application in a frozen state for a longer period of time (for example, it will not get CPU time), the official adjusted the way the application receives broadcasts registered for the context after entering the cache state.

Faster application launch speed

Along with Android 14's optimizations for cached apps and broadcasts comes "a long-standing limit on the number of cached apps on the platform," Android 14 reduces the number of cold starts of apps, and the larger the device's RAM, "the more obvious the improvement."

The beta group saw a 20% reduction in cold app launches on devices with 8GB of RAM and a 30% reduction on devices with 12GB of RAM. Cold launches are slower and use more battery than warm launches. This work has significantly improved battery consumption and overall app launch times.

Reduce memory footprint

Improving the Android Runtime (ART) has a huge impact on the Android user experience.

Code size is one of Google's key metrics: the smaller the generated file, the less memory (including RAM and storage space) it takes up. In Android 14, ART can reduce code size by an average of 9.3% without affecting performance.

Customization

Customized experience is the core gene of Android. Officials said that Android 14 will further focus on the user's customized experience, thereby improving accessibility and internationalization functions.

Non-linear font enlargement

Starting from Android 14, users can enlarge the font up to 200%.

Previously, fonts on Pixel devices could be enlarged up to 130%. The system uses a non-linear enlargement curve to make large text elements on the screen enlarge at different speeds than small text elements, thus preventing large text elements from being over-enlarged.

▲ (Left) 100% font size (Middle) Linear zoom to 200% (Right) Non-linear zoom to 200%, Image source: Google

Language preferences for each app

Developers can use LocaleManager.setOverrideLocaleConfig to dynamically update the localeConfig of the application to customize the list of languages ​​in the language list of each application in the Android settings page.

IME can now use LocaleManager.getApplicationLocales to get the interface language of the current application to update the keyboard language.

Starting with Android Studio Giraffe and AGP 8.1, developers can also configure their apps to automatically support Android 13 language preferences for each app.

New media features

▲ Image source: Google

Android 14 now supports 10-bit high dynamic range (HDR) images and ultra-strong HDR image formats. This format is fully backward compatible with JPEG, and apps can use HDR images seamlessly and render them using standard dynamic range as needed.

Super HDR image format

Android 14 upgrades and improves the camera extension function, allowing applications to support longer processing time and improve image quality through computationally intensive algorithms.

Lossless USB Audio

Android 14 devices support lossless audio formats, allowing you to get an audiophile-grade audio experience through USB wired headphones

New graphics features

Android 14 adds support for custom meshes, which can be defined as triangles or triangle strips and can support indexing as needed. These meshes are written in AGSL and contain custom attributes, vertex spans, varying variables, and vertex/fragment shaders.

Canvas Hardware Buffer Renderer

Android 14 introduces HardwareBufferRenderer, which enables Android's Canvas API to use hardware acceleration when drawing in HardwareBuffer. This feature is particularly useful when the use case involves communicating with the system compositor through SurfaceControl for low-latency drawing.

Cross-device and multi-size screen development

Based on Android 12L and 13, Android 14 continues to provide good support for tablets and foldable devices: for example, allowing the taskbar to better support multitasking, releasing system applications and notification interfaces optimized for large screens, Activity embedding, improving mailbox mode and media projection, etc.

Improve productivity

Many updates in Android 14 will make the user development experience more consistent, more interesting, and more efficient. Many of these updates will also be provided on previous platform versions through Google Play system updates, Jetpack development libraries, and Google Play services, making it easier to reach more users.

OpenJDK 17 support

With Google Play system updates (Project Mainline), over 600 million devices received the latest Android Runtime (ART) update released with Android 14.

Google Play system updates

Credential Manager and Passkeys

Credential Manager is a new Jetpack API that helps developers simplify integration by supporting multiple login methods such as username and password, passkey, and federated login solutions (such as Sign in with Google) through a single API. Credential Manager is supported all the way back to Android 4.4 (API level 19) through Google Play Services.

Health Connect

Health Connect is a user-controlled, on-device content library for user health and fitness data, making it easier than ever to implement an integrated health and fitness experience across apps and devices. Health Connect is part of the Android platform and is updated through Google Play system updates, without the need for separate downloads. On earlier devices, it is available as an app and can be downloaded through the Google Play Store.

▲ Image source: Google

More powerful system Sharesheet

Android 14's system Sharesheet can add custom actions and improve the ranking mechanism of sharing targets, making it easy for your app to provide users with a rich and consistent sharing experience.

Improve ranking of direct sharing targets

Android 14 updates the requirements for declaring foreground service types and requesting specific types of permissions.

Google Play Services has also introduced new policies to ensure that developers use these APIs reasonably. The official also added a new user-initiated data transfer job type, which can set constraints for JobScheduler to simplify the management of large user-initiated uploads and downloads (such as setting network constraints to only allow downloads over unmetered Wi-Fi).

User Experience

Predictive Return

Following the introduction of the "Return to Home Screen" animation in Android 13, Android 14 introduced a new predictive back system animation across activities and tasks. This system animation can still be manually enabled in the developer options to allow time for more polishing and allow more apps to choose to adapt to predictive returns. The Material and Jetpack libraries currently provide predictive return animations for everyone to use.

Privacy and Security

Users will see a new description in the runtime authorization dialog for location information that highlights situations in which an app shares location data with a third party, giving them more information and control over an app's access to that data.

▲ Image source: Google

Grant limited access to photos and videos

In Android 14 (API level 34), users can grant limited access to their photos and videos when their app requests any of the visual media permissions (READ_MEDIA_IMAGES or READ_MEDIA_VIDEO) introduced in Android 13 (API level 33). We recommend that you adopt the latest best practices in your app to adapt to this change.

Start Activity in the background

Android 10 (API level 29) and above impose restrictions on when apps can start an Activity while it is running in the background. To further reduce interruptions to the user experience, apps targeting Android 14 need to grant launch privileges to start an Activity in the background when sending a PendingIntent or binding a service.

Block installation of apps using older SDK versions

To prevent malware from exploiting older APIs to bypass the latest security and privacy protections, starting with Android 14, apps with a targetSdkVersion lower than 23 will not be installed.

Runtime Receiver

Apps targeting Android 14 must indicate whether dynamic Context.registerReceiver () usage should be considered "exported" or "unexported". This is a continuation of manifest-level work from previous releases, visit the official documentation for details:

Safe full-screen intent notifications

Because full-screen intent notifications are designed for extremely high-priority notifications that require the user's immediate attention, Android 14 will only allow apps that provide calling and alarm functionality to obtain this permission at installation time. Your app can launch the settings page for the user to complete the authorization.

Safer dynamic code loading

Files dynamically loaded by apps targeting Android 14 need to be marked as read-only.

Safer Implicit Intents

Apps targeting Android 14 will throw an exception when creating mutable PendingIntents using implicit Intents to prevent them from being used to trigger unexpected code paths.

App Compatibility

When releasing a new platform version, the official said that "it will give priority to application compatibility" to "make the update process faster and smoother."

In Android 14, most app-oriented changes are still optional, which will provide you with more time to adjust and adapt until developers upgrade the targetSdkVersion of the app to 34. We have also updated tools and processes to help you get ready faster.

Easier testing and debugging of changes

To make it easier for developers to test optional changes that may affect apps, the official still provides switch options for many changes this year. You can "force enable or disable these changes individually" in "Developer Options" or adb.

▲ Application compatibility switch in developer options, source: Google

Officials claim that if you are a developer of SDKs, development libraries, tools, and game engines, it is very important to release the necessary updates now:

Your updates can protect downstream app and game developers from compatibility issues and enable them to introduce the latest SDK features in a timely manner. Therefore, please be sure to inform your downstream developers in a timely manner after releasing the compatibility updates required by Android 14.

Simply install your production app from Google Play or another source on a device running Android 14 to start testing. Test all flows of your app to identify issues in functionality or UI. Use the behavior change checklist (for all apps) to focus your testing.

With each release of Android, we make overall improvements to the platform to strengthen privacy and security and optimize the user experience across the entire operating system, all of which may affect your app.

refer to

  • Latest version released | Android 14 is now officially released to AOSP!

<<:  Apple releases dual system update!

>>:  iOS event response chain and event delivery principle

Recommend

Tea Science | Why do young people love drinking tea?

Oh my God, is there any way out for young people ...

Kuaishou information flow advertising delivery process

On Kuaishou, users can use photos and short video...

After 27 years of outstanding achievements, Ariane 5 rocket officially ends

In the early morning of July 6, Beijing time, Eur...

Google Play enters China, starting with serving Chinese developers

December 10th may be a day worth remembering. On ...

Exploring Eternity: Gödel and Einstein

Einstein has many intriguing quotes, such as he s...

Bleder tutorial takes off in 2021 [good quality and material]

Bleder tutorial takes off in 2021 [good quality a...

After this barren land was "reborn", it was "affirmed" by the "desert elves"

Recently, the national second-level key protected...