Posted by Dave Burke, VP of Engineering
Right this moment we’re releasing the second beta of Android 15, which continues our work to construct a platform that helps enhance your productiveness, reduce battery influence, maximize clean app efficiency, give customers a premium system expertise, shield person privateness and safety, and make your app accessible to as many individuals as potential — all in a vibrant and various ecosystem of units, silicon companions, and carriers.
Android delivers enhancements and new options year-round, and your suggestions on the Android beta program performs a key function in serving to Android constantly enhance. The Android 15 developer web site has tons extra details about the beta, together with downloads for Pixel, and the launch timeline. We’re trying ahead to listening to what you assume, and thanks upfront on your continued assist in making Android a platform that works for everybody.
Now out there on extra units
The Android 15 beta is now out there on handset, pill, and foldable kind components from companions together with Honor, iQOO, Lenovo, Nothing, OnePlus, OPPO, Realme, Sharp, Tecno, vivo, and Xiaomi, so there are such a lot of extra units so that you can check your app on, and so many extra customers that may run your app on the Android 15 beta.
Making Android extra environment friendly
We’re persevering with to optimize the platform to enhance the standard, velocity and battery lifetime of Android units.
Foreground providers modifications
Foreground providers maintain apps working in an energetic state to allow them to do one thing crucial and user-visible, typically on the expense of battery life. In Android 15 Beta 2, the dataSync and mediaProcessing foreground service sorts now have a ~6 hour timeout, after which the system calls Android 15’s new Service.onTimeout(int, int) methodology. At this level, the service is now not thought-about a foreground service. If the service doesn’t name Service.stopSelf() in response to the timeout, it’ll get stopped with a failure.
Beta 2 additionally provides new necessities for beginning foreground providers whereas the app is working within the background. – In case your foreground service depends on the SYSTEM_ALERT_WINDOW permission exemption for background begin, you are actually required to have a visual overlay when focusing on Android 15.
For battery-efficient finest practices, debugging community and energy utilization, and element on how we’re bettering battery effectivity of background work in Android 15 and up to date variations of Android, see the “Bettering battery effectivity of background work on Android” I/O discuss.
Upcoming required help for 16 KB web page sizes
Android 15 provides help for units that use bigger web page sizes, with help for 16 KB pages along with the usual 4 KB pages. In case your app makes use of any NDK libraries, both straight or not directly by way of an SDK, then you’ll possible want to easily rebuild your app for it to work on these 16 KB web page dimension units.
Gadgets with bigger web page sizes can have improved efficiency for memory-intensive workloads. Whereas our testing might not be consultant of all units within the ecosystem, listed below are a a few of the efficiency positive factors we recognized in our preliminary testing of units configured with 16KB web page sizes:
- Decrease app launch instances whereas the system is below reminiscence stress: 3.16% decrease on common, with extra important enhancements (as much as 30%) for some apps that we examined
- Decreased energy draw throughout app launch: 4.56% discount on common
- Sooner digital camera launch: 4.48% quicker scorching begins on common, and 6.60% quicker chilly begins on common
- Improved system boot time: improved by 1.5% (roughly 0.8 seconds) on common
As system producers proceed to construct units with bigger quantities of bodily reminiscence (RAM), many of those units will undertake 16 KB (and ultimately larger) web page sizes to optimize the system’s efficiency. Including help for 16 KB web page dimension units allows your app to run on these units and helps your app profit from the related efficiency enhancements. We plan to make 16 KB web page compatibility required for app uploads to Play Retailer subsequent 12 months.
That will help you add help on your app, we have offered steering on find out how to test in case your app is impacted, find out how to rebuild your app (if relevant), and find out how to check your app in a 16 KB surroundings utilizing emulators (together with Android 15 system photos for the Android Emulator).
Modernizing Android’s GPU entry
Android {hardware} has developed fairly a bit from the early days the place the core OS would run on a single CPU and GPUs have been accessed utilizing APIs primarily based on fixed-function pipelines. The Vulkan graphics API has been out there within the NDK since Android 7.0 (API stage 24) with a lower-level abstraction that higher displays trendy GPU {hardware}, scales higher to help a number of CPU cores, and affords decreased CPU driver overhead — resulting in improved app and sport efficiency. Vulkan is supported by all trendy sport engines.
Vulkan is Android’s most well-liked interface to the GPU. Subsequently, Android 15 contains ANGLE as an non-compulsory layer for working OpenGL ES on prime of Vulkan. Shifting to ANGLE will standardize the Android OpenGL implementation for improved compatibility, and, in some instances, improved efficiency. You may check out your OpenGL ES app stability and efficiency with ANGLE utilizing the “Developer choices → Experimental: Allow ANGLE” setting in Android 15.
The Android ANGLE on Vulkan roadmap
As a part of streamlining our GPU stack, going ahead we can be delivery ANGLE because the GL system driver on extra new units, with the longer term expectation that OpenGL/ES can be solely out there by way of ANGLE. That being stated, we plan to proceed help for OpenGL ES on all units.
Really useful subsequent steps: Use the developer choices to pick out the ANGLE driver for OpenGL ES and check. For brand spanking new initiatives, we strongly encourage utilizing Vulkan for C/C++.
Trendy graphics
Android 15 continues our modernization of Android’s Canvas graphics system with new performance:
- Matrix44, gives a 4×4 matrix for remodeling coordinates that must be used whenever you need to manipulate the canvas in 3D.
- clipShader intersects the present clip with the desired shader, whereas clipOutShader units the clip to the distinction of the present clip and the shader, every treating the shader as an alpha masks. This helps the drawing of advanced shapes effectively.
Extra environment friendly AV1 software program decoding
dav1d, the favored AV1 software program decoder from VideoLAN is now out there for Android units not supporting AV1 decode in {hardware}. It’s as much as 3x extra performant than the legacy AV1 software program decoder, enabling HD AV1 playback for extra customers, together with some low and mid tier units.
For now, your app must opt-in to utilizing dav1d by invoking it by identify “c2.android.av1-dav1d.decoder“. It is going to be made the default AV1 software program decoder in a subsequent replace . This help is standardized and backported to Android 11 units that obtain Google Play system updates.
For extra on the most recent options and developer options for Android media and digital camera, see the “Constructing trendy Android media and digital camera experiences” I/O discuss.
A extra non-public, safe Android
We’re at all times trying to give customers extra transparency and management over their information whereas enhancing the core safety features of the platform. See the “Safeguarding person safety on Android” I/O discuss for extra of what we’re doing to enhance person safeguards and shield your app towards new threats.
Non-public area
Non-public area permits customers to create a separate area on their system the place they will maintain delicate apps away from prying eyes, below an extra layer of authentication. Non-public area makes use of a separate person profile. When non-public area is locked by the person, the profile is paused, i.e. the apps are now not energetic. The person can select to make use of the system lock or a separate lock issue for personal area. Non-public area apps present up in a separate container within the launcher, and are hidden from the recents view, notifications, settings, and from different apps when non-public area is locked. Person generated and downloaded content material (media, recordsdata) and accounts are separated between the non-public area and the principle area. The system sharesheet and the picture picker can be utilized to offer apps entry to content material throughout areas when non-public area is unlocked. Android 15 beta 2.1 partially corrects a recognized challenge with non-public area in beta 2 that affected house display apps.
Chosen photographs entry enchancment
It’s now potential for apps to spotlight solely probably the most just lately chosen photographs and movies when partial entry to media permissions is granted. This could enhance the person expertise for apps that ceaselessly request entry to photographs and movies. This may be achieved by enabling the QUERY_ARG_LATEST_SELECTION_ONLY argument when querying MediaStore by way of ContentResolver.
valexternalContentUri = MediaStore.Information.getContentUri("exterior") val mediaColumns = arrayOf( FileColumns._ID, FileColumns.DISPLAY_NAME, FileColumns.MIME_TYPE, ) val queryArgs = bundleOf( // Return solely objects from the final choice (chosen photographs entry) QUERY_ARG_LATEST_SELECTION_ONLY to true, // Kind returned objects chronologically primarily based on after they have been added to the system's storage QUERY_ARG_SQL_SORT_ORDER to "${FileColumns.DATE_ADDED} DESC", QUERY_ARG_SQL_SELECTION to "${FileColumns.MEDIA_TYPE} = ? OR ${FileColumns.MEDIA_TYPE} = ?", QUERY_ARG_SQL_SELECTION_ARGS to arrayOf( FileColumns.MEDIA_TYPE_IMAGE.toString(), FileColumns.MEDIA_TYPE_VIDEO.toString() ) ) val cursor = contentResolver.question(externalContentUri, mediaColumns, queryArgs, null)
Permission checks on content material URIs
Android 15 introduces a brand new set of APIs that carry out permission checks on content material URIs. They embody:
Secured background exercise launches
Android 15 protects customers from malicious apps and offers them extra management over their units by including modifications that forestall malicious background apps from bringing different apps to the foreground, elevating their privileges, and abusing person interplay. Background exercise launches have been restricted since Android 10.
Malicious apps throughout the similar activity can launch one other app’s exercise, then overlay themselves on prime, creating the phantasm of being that app. This “activity hijacking” assault bypasses present background launch restrictions as a result of all of it happens throughout the similar seen activity. To mitigate this danger, we have added a flag that blocks apps that do not match the highest UID on the stack from launching actions. To decide in for your whole app’s actions, replace the allowCrossUidActivitySwitchFromBelow attribute in your app’s AndroidManifest.xml file:
<utility android:allowCrossUidActivitySwitchFromBelow="false" >
As soon as your app has opted into the brand new safety, particular actions designed to be shared could be opted-out utilizing this API throughout the Exercise:
public void onCreate(Bundle bundle) {
tremendous.onCreate(bundle);
setAllowCrossUidActivitySwitchFromBelow(true);
...
}
Study extra about restrictions on beginning actions from the background.
Safer Intents
Android 15 introduces new safety measures to make intents safer and extra strong. These modifications are aimed toward stopping potential vulnerabilities and misuse of intents that may be exploited by malicious apps. There are two essential enhancements to the safety of intents in Android 15:
- Match goal intent-filters: Intents that concentrate on particular parts should precisely match the goal’s intent-filter specs. In the event you ship an intent to launch one other app’s exercise, the goal intent element must align with the receiving exercise’s declared intent-filters.
- Intents should have actions: Intents with out an motion will now not match any intent-filters. Which means that intents used to begin actions or providers should have a clearly outlined motion.
Necessary: These enhancements can be a part of Strict Mode. If you need to attempt them out please add the next methodology:
public void onCreate() {
StrictMode.setVmPolicy(VmPolicy.Builder()
.detectUnsafeIntentLaunch()
.construct());
...
Elevated minimal goal SDK model from 23 to 24
Android 15 will increase the minimal targetSdkVersion required to put in apps from 23 to 24, constructing on the earlier minimal goal SDK change from Android 14, Outdated apps typically lack the most recent safety protections, making units and information weak. Requiring apps to fulfill trendy API ranges helps to make sure higher safety and privateness.
In the event you attempt to set up an app that targets a decrease API stage than 24, you may see an error raised in Logcat:
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App bundle should goal at the least SDK model 24, however discovered 7.
A premium system expertise
Android 15 contains options that assist your apps enhance the expertise of utilizing an Android system, together with smoother transitions, a extra useful UI, updates for large-screen units, and extra stunning choices for designers.
Improved giant display multitasking
Android 15 beta 2 provides customers higher methods to multitask on giant display units. For instance, customers can pin the taskbar on display to rapidly swap between apps or save their favourite split-screen app combos for fast entry. Which means that ensuring your app is adaptive is extra essential than ever. Google I/O has classes on Constructing adaptive Android apps and Constructing UI with the Materials 3 adaptive library that may assist, and our documentation has extra that will help you Design for giant screens.
Window Insets
Along with edge-to-edge enforcement, when focusing on SDK 35+ in Android 15 Configuration.screenWidthDp and screenHeightDp, now embody the depth of the system bars. Whereas these values should be used for useful resource choice (e.g. res/layout-h500dp), utilizing them for structure calculations is discouraged.
Image-in-Image
Android 15 introduces new modifications in Image-in-Image (PiP) guaranteeing a good smoother transition when coming into into PiP mode. This can be useful for apps having UI components overlaid on prime of their essential UI, which works into PiP. Presently, onPictureInPictureModeChanged is used to outline logic that toggles the visibility of the overlaid UI components. This callback is triggered when the PiP enter or exit animation is accomplished. Ranging from Android 15, we’re introducing a brand new state within the PictureInPictureUiState class. The onPictureInPictureUiStateChanged callback can be invoked with isTransitioningToPip() as quickly because the PiP enter animation begins and the app can conceal the overlaid UI components.
override enjoyable onPictureInPictureUiStateChanged(pipState: PictureInPictureUiState) {
if (pipState.isTransitioningToPip()) {
// Cover UI components
}
}
override enjoyable onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
if (isInPictureInPictureMode) {
// Unhide UI components
}
}
This fast visibility toggle of irrelevant UI components (for a PiP window), will guarantee a smoother and flicker free PiP enter animation.
Richer Widget Previews with Generated Previews
Make your widget stand out by displaying a customized preview. Apps focusing on Android 15 can present Distant Views to the Widget Picker, to allow them to replace the content material within the picker to be extra consultant of what the person will see. Apps might use the AppWidgetManager setWidgetPreview, getWidgetPreview and removeWidgetPreview strategies to replace the looks of their widgets with updated and personalised info.
Predictive Again
Predictive again gives a smoother, extra intuitive navigation expertise whereas utilizing gesture navigation, leveraging built-in animations to tell customers the place their actions will take them to cut back surprising outcomes. In Android 15, predictive again will now not be behind a developer possibility, so system animations comparable to back-to-home, cross-task, and cross-activity will seem for apps which have correctly migrated.
Set VibrationEffect for notification channels
Android 15 beta 2 now helps setting wealthy vibrations for incoming notifications by channel utilizing NotificationChannel.setVibrationEffect, so your customers can distinguish between various kinds of notifications with out having to take a look at their system.
New information sorts for Well being Join
Well being Join, the centralized manner for customers to regulate and handle entry to their health information, is including help for extra information sorts to help much more well being and health use instances. This launch has 2 new information sorts: pores and skin temperature and coaching plans.
Pores and skin temperature monitoring permits customers to retailer and share extra correct temperature information from a wearable or different monitoring system.
Coaching plans are structured exercise plans to assist a person obtain their health objectives. Coaching plans help contains:
“Select the way you’re addressed” system choice
Initially solely in French, however increasing quickly to further gendered languages, customers can customise how they’re addressed by the Android system with a grammatical gender choice. The brand new setting could be discovered within the system language settings: Settings → System → Languages & Enter → System languages → Select the way you’re addressed.
French grammatical gender choice
An instance of the place this choice modifications the string being proven
Trendy internationalization through ICU 74
Android 15 Beta 2 contains API-related updates from ICU 74. ICU 74 comprises updates from Unicode 15.1, together with new characters, emoji, safety mechanisms and corresponding APIs and implementations, in addition to updates to CLDR 44 locale information with new locales and numerous additions and corrections.
CJK Variable Font
Ranging from Android 15, the font file for Chinese language, Japanese, and Korean languages, NotoSansCJK, is now a variable font. Variable fonts open up new potentialities for inventive typography in CJK languages. Designers can discover a broader vary of kinds and create visually hanging layouts that have been beforehand troublesome or inconceivable to attain.
New Japanese Hentaigana Font
In Android 15, a brand new font file for previous Japanese Hiragana (referred to as Hentaigana) is bundled by default. The distinctive shapes of Hentaigana characters can add a particular aptitude to paintings or design whereas additionally serving to to protect correct transmission and understanding of historic Japanese paperwork.
Avoiding clipped textual content
Some cursive fonts or language characters which have advanced shaping might draw the letters within the earlier or subsequent character’s space. Such letters could also be clipped firstly or ending place. Beginning in Android 15, TextView allocates further width for such letters and places further padding to the left.
As a result of this modifications how the TextView decides the width, TextView allocates extra width by default if the functions goal Android 15 or later. You may allow or disable it by calling setUseBoundsForWidth API on TextView. As a result of including left padding might trigger a misalignment of present layouts, the padding isn’t added by default even when focusing on Android 15 or later.
So as to add further padding to stop clipping, name setShiftDrawingOffsetForStartOverhang.
<TextView
android:fontFamily="cursive"
android:textual content="java" />
<TextView
android:fontFamily="cursive"
android:textual content="java"
android:useBoundsForWidth="true"
android:shiftDrawingOffsetForStartOverhang="true" />
<TextView
android:textual content="คอมพิวเตอร์" />
<TextView
android:textual content="คอมพิวเตอร์"
android:useBoundsForWidth="true"
android:shiftDrawingOffsetForStartOverhang="true" />
App compatibility
If you have not but examined your app for compatibility with Android 15, now could be the time to do it, with many extra units coming into this system. Within the weeks forward, you possibly can count on extra customers to attempt your app on Android 15 and lift points they discover.
To check for compatibility, set up your revealed app on a tool or emulator working Android 15 beta and work by way of your whole app’s flows. Evaluate the conduct modifications to focus your testing. After you have resolved any points, publish an replace as quickly as potential.
To provide you extra time to plan for app compatibility work, we’re letting you realize our Platform Stability milestone effectively upfront.
At this milestone, we’ll ship closing SDK/NDK APIs and likewise closing inside APIs and app-facing system behaviors. We’re anticipating to succeed in Platform Stability in June 2024, and from that point you’ll have a number of months earlier than the official launch to do your closing testing. The discharge timeline particulars are right here.
Get began with Android 15
Right this moment’s beta launch has all the things that you must attempt the Android 15 options, check your apps, and provides us suggestions. Now that we’re within the beta part, you possibly can test right here to get details about enrolling your system; Enrolling supported Pixel units will get this and future Android Beta updates over-the-air. In the event you don’t have a supported system, you possibly can use the 64-bit system photos with the Android Emulator in Android Studio. In the event you’re already within the Android 14 QPR beta program on a supported system, you may routinely get up to date to Android 15 Beta 2.
For one of the best growth expertise with Android 15, we advocate that you just use the newest model of Android Studio Koala. When you’re arrange, listed below are a few of the issues it is best to do:
- Strive the brand new options and APIs – your suggestions is crucial through the early a part of the developer preview and beta program. Report points in our tracker on the suggestions web page.
- Take a look at your present app for compatibility – study whether or not your app is affected by modifications in Android 15; set up your app onto a tool or emulator working Android 15 and extensively check it.
We’ll replace the beta system photos and SDK usually all through the Android 15 launch cycle. Learn extra right here.
For full info, go to the Android 15 developer web site.
Java and OpenJDK are emblems or registered emblems of Oracle and/or its associates.
OpenGL is a registered trademark and the OpenGL ES emblem is a trademark of Hewlett Packard Enterprise utilized by permission by Khronos.
Vulkan and the Vulkan emblem are registered emblems of the Khronos Group Inc.
VideoLAN cone Copyright (c) 1996-2010 VideoLAN. This emblem or a modified model could also be used or modified by anybody to check with the VideoLAN undertaking or any product developed by the VideoLAN crew, however doesn’t point out endorsement by the undertaking.
All emblems, logos and model names are the property of their respective house owners.