
Posted by Dave Burke, VP of Engineering
Right now we’re releasing the second beta of Android 15, which continues our work to construct a platform that helps enhance your productiveness, reduce battery affect, maximize easy app efficiency, give customers a premium machine expertise, shield person privateness and safety, and make your app accessible to as many individuals as potential — all in a vibrant and numerous ecosystem of gadgets, 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 website 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 suppose, and thanks upfront in your continued assist in making Android a platform that works for everybody.
Now out there on extra gadgets
The Android 15 beta is now out there on handset, pill, and foldable type elements from companions together with Honor, iQOO, Lenovo, Nothing, OnePlus, OPPO, Realme, Sharp, Tecno, vivo, and Xiaomi, so there are such a lot of extra gadgets so that you can take a look at 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 gadgets.
Foreground providers modifications
Foreground providers preserve apps operating in an energetic state to allow them to do one thing crucial and user-visible, usually 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) technique. At this level, the service is not thought-about a foreground service. If the service doesn’t name Service.stopSelf() in response to the timeout, it is going to get stopped with a failure.
Beta 2 additionally provides new necessities for beginning foreground providers whereas the app is operating 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 assist for 16 KB web page sizes
Android 15 provides assist for gadgets that use bigger web page sizes, with assist for 16 KB pages along with the usual 4 KB pages. In case your app makes use of any NDK libraries, both instantly or not directly by means of an SDK, then you’ll probably want to easily rebuild your app for it to work on these 16 KB web page measurement gadgets.
Gadgets with bigger web page sizes can have improved efficiency for memory-intensive workloads. Whereas our testing might not be consultant of all gadgets within the ecosystem, listed below are a among the efficiency good points we recognized in our preliminary testing of gadgets 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
- Diminished energy draw throughout app launch: 4.56% discount on common
- Sooner digital camera launch: 4.48% sooner scorching begins on common, and 6.60% sooner chilly begins on common
- Improved system boot time: improved by 1.5% (roughly 0.8 seconds) on common
As machine producers proceed to construct gadgets with bigger quantities of bodily reminiscence (RAM), many of those gadgets will undertake 16 KB (and finally higher) web page sizes to optimize the machine’s efficiency. Including assist for 16 KB web page measurement gadgets permits your app to run on these gadgets 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 yr.
That will help you add assist in your app, we have supplied steering on tips on how to examine in case your app is impacted, tips on how to rebuild your app (if relevant), and tips on how to take a look at your app in a 16 KB surroundings utilizing emulators (together with Android 15 system pictures for the Android Emulator).
Modernizing Android’s GPU entry
Android {hardware} has advanced 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 assist a number of CPU cores, and provides diminished CPU driver overhead — resulting in improved app and sport efficiency. Vulkan is supported by all trendy sport engines.
Vulkan is Android’s most popular interface to the GPU. Subsequently, Android 15 contains ANGLE as an non-obligatory layer for operating OpenGL ES on prime of Vulkan. Transferring to ANGLE will standardize the Android OpenGL implementation for improved compatibility, and, in some circumstances, improved efficiency. You’ll be able to take a look at 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 transport ANGLE because the GL system driver on extra new gadgets, with the longer term expectation that OpenGL/ES can be solely out there by means of ANGLE. That being mentioned, we plan to proceed assist for OpenGL ES on all gadgets.
Really helpful subsequent steps: Use the developer choices to pick out the ANGLE driver for OpenGL ES and take a look at. For brand spanking new tasks, we strongly encourage utilizing Vulkan for C/C++.
Fashionable 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 needs to be used if you wish to manipulate the canvas in 3D.
- clipShader intersects the present clip with the required 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 gadgets 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 gadgets.
For now, your app must opt-in to utilizing dav1d by invoking it by identify “c2.android.av1-dav1d.decoder“. Will probably be made the default AV1 software program decoder in a subsequent replace . This assist is standardized and backported to Android 11 gadgets 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 personal, safe Android
We’re all the time trying to give customers extra transparency and management over their knowledge 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 house
Non-public house permits customers to create a separate house on their machine the place they will preserve delicate apps away from prying eyes, below a further layer of authentication. Non-public house makes use of a separate person profile. When personal house is locked by the person, the profile is paused, i.e. the apps are not energetic. The person can select to make use of the machine lock or a separate lock issue for personal house. Non-public house apps present up in a separate container within the launcher, and are hidden from the recents view, notifications, settings, and from different apps when personal house is locked. Person generated and downloaded content material (media, information) and accounts are separated between the personal house and the primary house. The system sharesheet and the photograph picker can be utilized to provide apps entry to content material throughout areas when personal house is unlocked. There’s a identified difficulty with personal house in Beta 2 that impacts dwelling display apps; you will discover out extra within the Beta 2 launch notes. We’ll have an replace within the coming days, so you might want to wait till then to check your app with personal house to ensure it really works as anticipated.
Chosen images entry enchancment
It’s now potential for apps to spotlight solely essentially the most lately chosen images and movies when partial entry to media permissions is granted. This could enhance the person expertise for apps that ceaselessly request entry to images and movies. This may be achieved by enabling the QUERY_ARG_LATEST_SELECTION_ONLY argument when querying MediaStore by means 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 images entry) QUERY_ARG_LATEST_SELECTION_ONLY to true, // Type returned objects chronologically primarily based on once they have been added to the machine'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 embrace:
Secured background exercise launches
Android 15 protects customers from malicious apps and offers them extra management over their gadgets by including modifications that stop 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 inside the identical 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 inside the identical 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 choose in for your entire app’s actions, replace the allowCrossUidActivitySwitchFromBelow attribute in your app’s AndroidManifest.xml file:
<software android:allowCrossUidActivitySwitchFromBelow="false" >
As soon as your app has opted into the brand new safety, particular actions designed to be shared may be opted-out utilizing this API inside 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 geared toward stopping potential vulnerabilities and misuse of intents that may be exploited by malicious apps. There are two major 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. If you happen to 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 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 want to attempt them out please add the next technique:
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 usually lack the most recent safety protections, making gadgets and knowledge weak. Requiring apps to fulfill trendy API ranges helps to make sure higher safety and privateness.
If you happen to attempt to set up an app that targets a decrease API stage than 24, you will see an error raised in Logcat:
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App bundle should goal not less than SDK model 24, however discovered 7.
A premium machine expertise
Android 15 contains options that assist your apps enhance the expertise of utilizing an Android machine, together with smoother transitions, a extra useful UI, updates for large-screen gadgets, and extra lovely choices for designers.
Improved giant display multitasking
Android 15 beta 2 offers customers higher methods to multitask on giant display gadgets. For instance, customers can pin the taskbar on display to rapidly change 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 can assist you Design for big screens.
Window Insets
Along with edge-to-edge enforcement, when focusing on SDK 35+ in Android 15 Configuration.screenWidthDp and screenHeightDp, now embrace the depth of the system bars. Whereas these values should still 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) making certain an excellent smoother transition when getting into into PiP mode. This can be useful for apps having UI parts overlaid on prime of their major UI, which matches into PiP. Presently, onPictureInPictureModeChanged is used to outline logic that toggles the visibility of the overlaid UI parts. 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 cover the overlaid UI parts.
override enjoyable onPictureInPictureUiStateChanged(pipState: PictureInPictureUiState) {
if (pipState.isTransitioningToPip()) {
// Cover UI parts
}
}
override enjoyable onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
if (isInPictureInPictureMode) {
// Unhide UI parts
}
}
This fast visibility toggle of irrelevant UI parts (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 exhibiting 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 customized 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 not be behind a developer choice, so system animations similar 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 several types of notifications with out having to have a look at their machine.
New knowledge sorts for Well being Join
Well being Join, the centralized approach for customers to manage and handle entry to their health knowledge, is including assist for added knowledge sorts to assist much more well being and health use circumstances. This launch has 2 new knowledge sorts: pores and skin temperature and coaching plans.
Pores and skin temperature monitoring permits customers to retailer and share extra correct temperature knowledge from a wearable or different monitoring machine.
Coaching plans are structured exercise plans to assist a person obtain their health targets. Coaching plans assist contains:
“Select the way you’re addressed” system desire
Initially solely in French, however increasing quickly to extra gendered languages, customers can customise how they’re addressed by the Android system with a grammatical gender desire. The brand new setting may be discovered within the system language settings: Settings → System → Languages & Enter → System languages → Select the way you’re addressed.
French grammatical gender desire
An instance of the place this desire modifications the string being proven
Fashionable internationalization through ICU 74
Android 15 Beta 2 contains API-related updates from ICU 74. ICU 74 accommodates 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 knowledge with new locales and varied 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 artistic typography in CJK languages. Designers can discover a broader vary of kinds and create visually hanging layouts that have been beforehand troublesome or unimaginable to realize.
New Japanese Hentaigana Font
In Android 15, a brand new font file for previous Japanese Hiragana (often called 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 historical 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 in the beginning or ending place. Beginning in Android 15, TextView allocates extra 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 purposes goal Android 15 or later. You’ll be able to 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 forestall 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’s the time to do it, with many extra gadgets getting 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 printed app on a tool or emulator operating Android 15 beta and work by means of your entire 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 offer you extra time to plan for app compatibility work, we’re letting our Platform Stability milestone nicely upfront.
At this milestone, we’ll ship closing SDK/NDK APIs and likewise closing inner APIs and app-facing system behaviors. We’re anticipating to achieve 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 now’s beta launch has every thing you have to attempt the Android 15 options, take a look at your apps, and provides us suggestions. Now that we’re within the beta section, you possibly can examine right here to get details about enrolling your machine; Enrolling supported Pixel gadgets will get this and future Android Beta updates over-the-air. If you happen to don’t have a supported machine, you possibly can use the 64-bit system pictures with the Android Emulator in Android Studio. If you happen to’re already within the Android 14 QPR beta program on a supported machine, you will routinely get up to date to Android 15 Beta 2.
For the perfect growth expertise with Android 15, we suggest that you simply use the newest model of Android Studio Koala. When you’re arrange, listed below are among the issues it’s best to do:
- Attempt 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.
- Check 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 operating Android 15 and extensively take a look at it.
We’ll replace the beta system pictures and SDK recurrently all through the Android 15 launch cycle. Learn extra right here.
For full info, go to the Android 15 developer website.
Java and OpenJDK are logos or registered logos of Oracle and/or its associates.
OpenGL is a registered trademark and the OpenGL ES brand is a trademark of Hewlett Packard Enterprise utilized by permission by Khronos.
Vulkan and the Vulkan brand are registered logos of the Khronos Group Inc.
VideoLAN cone Copyright (c) 1996-2010 VideoLAN. This brand or a modified model could also be used or modified by anybody to confer with the VideoLAN mission or any product developed by the VideoLAN staff, however doesn’t point out endorsement by the mission.
All logos, logos and model names are the property of their respective house owners.