Android 15 introduce nuove fantastiche funzionalità e API per gli sviluppatori. Le seguenti sezioni riassumono queste funzionalità per aiutarti a iniziare a utilizzare le API correlate.
Per un elenco dettagliato delle API nuove, modificate e rimosse, leggi il report sulle differenze delle API. Per maggiori dettagli sulle nuove API, visita il Riferimento API Android. Le nuove API sono evidenziate per garantire la visibilità. Inoltre, per saperne di più sulle aree in cui le modifiche alla piattaforma potrebbero interessare le tue app, assicurati di esaminare le modifiche al comportamento di Android 15 che interessano le app quando hanno come target Android 15 e i cambiamenti di comportamento che interessano tutte le app indipendentemente datargetSdkVersion
.
Fotocamera e contenuti multimediali
Android 15 include una serie di funzionalità che migliorano l'esperienza con la fotocamera e i contenuti multimediali e ti danno accesso a strumenti e hardware per aiutare i creator a trasformare la loro vision su Android.
Per ulteriori informazioni sulle ultime funzionalità e soluzioni per sviluppatori per contenuti multimediali e fotocamere Android, consulta l'articolo sulla creazione di esperienze con fotocamera e media Android moderni da Google I/O.
Aumento luce
Android 15 introduce la funzionalità Migliora Luce scarsa, una nuova modalità di esposizione automatica disponibile sia per la Fotocamera 2 che per l'estensione della fotocamera in modalità notturna. Luce scarsa regola l'esposizione dello stream Anteprima in condizioni di scarsa illuminazione. Questo processo è diverso da come l'estensione della fotocamera per la modalità notturna crea immagini fisse, perché la modalità notturna combina una serie di foto a raffica per creare un'unica immagine migliorata. Anche se la modalità notturna funziona molto bene per creare un'immagine statica, non è in grado di creare un flusso continuo di frame, a differenza di Low Light Boost. Grazie a Low Light Boost, la fotocamera abilita nuove funzionalità, tra cui:
- Fornire un'anteprima migliorata delle immagini per consentire agli utenti di inquadrare meglio le immagini in condizioni di scarsa illuminazione
- Scansione dei codici QR in condizioni di scarsa illuminazione
Se attivi Low Light Boost, la funzionalità si accende automaticamente quando c'è poca luce e si spegne quando c'è più luce.
Le app possono registrare durante lo streaming dell'anteprima in condizioni di scarsa illuminazione per salvare un video con luminosità maggiore.
Per ulteriori informazioni, vedi Migliora Luce scarsa.
Controlli della fotocamera in-app
Android 15 adds a new extension for more control over the camera hardware and its algorithms on supported devices:
- Advanced flash strength adjustments enabling precise control of flash
intensity in both
SINGLE
andTORCH
modes while capturing images.
Controllo dell'headroom HDR
Android 15 chooses HDR headroom that is appropriate for the underlying device
capabilities and bit-depth of the panel. For pages that have lots of SDR
content, such as a messaging app displaying a single HDR thumbnail, this
behavior can end up adversely influencing the perceived brightness of the SDR
content. Android 15 lets you control the HDR headroom with
setDesiredHdrHeadroom
to strike a balance between SDR
and HDR content.
![](https://developer.android.com/static/about/versions/15/images/hdr-headroom.png?authuser=7&hl=it)
Controllo del volume
Android 15 introduces support for the CTA-2075 loudness standard to help you avoid audio loudness inconsistencies and ensure users don't have to constantly adjust volume when switching between content. The system leverages known characteristics of the output devices (headphones and speaker) along with loudness metadata available in AAC audio content to intelligently adjust the audio loudness and dynamic range compression levels.
To enable this feature, you need to ensure loudness metadata is available in
your AAC content and enable the platform feature in your app. For this, you
instantiate a LoudnessCodecController
object by
calling its create factory method with the audio
session ID from the associated AudioTrack
; this
automatically starts applying audio updates. You can pass an
OnLoudnessCodecUpdateListener
to modify or filter
loudness parameters before they are applied on the
MediaCodec
.
// Media contains metadata of type MPEG_4 OR MPEG_D
val mediaCodec = …
val audioTrack = AudioTrack.Builder()
.setSessionId(sessionId)
.build()
...
// Create new loudness controller that applies the parameters to the MediaCodec
try {
val lcController = LoudnessCodecController.create(mSessionId)
// Starts applying audio updates for each added MediaCodec
}
AndroidX media3 ExoPlayer will also be updated to use the
LoudnessCodecController
APIs for a seamless app integration.
Dispositivi Virtual MIDI 2.0
Android 13 ha aggiunto il supporto della connessione a dispositivi MIDI 2.0 tramite USB, che comunicano tramite UMP (Universal MIDI Packets). Android 15 estende il supporto UMP alle app MIDI virtuali, consentendo alle app di composizione di controllare le app di sintetizzatore come dispositivo MIDI 2.0 virtuale come farebbero con un dispositivo USB MIDI 2.0.
Decodifica del software AV1 più efficiente
dav1d, the popular AV1 software decoder from VideoLAN is now available for Android devices that don't support AV1 decode in hardware. dav1d is up to 3x more performant than the legacy AV1 software decoder, enabling HD AV1 playback for more users, including some low and mid tier devices.
For now, your app needs to opt-in to using dav1d by invoking it by name
"c2.android.av1-dav1d.decoder"
. dav1d will be made the default AV1 software
decoder in a subsequent update. This support is standardized and backported to
Android 11 devices that receive Google Play system updates.
Produttività e strumenti per sviluppatori
Sebbene la maggior parte del nostro lavoro per migliorare la produttività sia incentrata su strumenti come Android Studio, Jetpack Compose e sulle librerie Android Jetpack, cerchiamo sempre nuovi modi all'interno della piattaforma per aiutarti a trasformare più facilmente la tua vision.
Aggiornamenti di OpenJDK 17
Android 15 continues the work of refreshing Android's core libraries to align with the features in the latest OpenJDK LTS releases.
The following key features and improvements are included:
- Quality-of-life improvements around NIO buffers
- Streams
- Additional
math
andstrictmath
methods util
package updates including sequencedcollection
,map
, andset
ByteBuffer
support inDeflater
- Security updates such as
X500PrivateCredential
and security key updates
These APIs are updated on over a billion devices running Android 12 (API level 31) and higher through Google Play System updates, so you can target the latest programming features.
Miglioramenti ai PDF
Android 15 include miglioramenti sostanziali alle API PdfRenderer
. Le app possono incorporare funzionalità avanzate come il rendering di file protetti da password, annotazioni, modifica di moduli, ricerca e selezione con testo. Le ottimizzazioni dei PDF linearizzati sono supportate per velocizzare la visualizzazione dei PDF locali e ridurre l'utilizzo di risorse.
![](https://developer.android.com/static/about/versions/15/images/pdf-rendering.png?authuser=7&hl=it)
Il PdfRenderer
è stato spostato in un modulo che può essere aggiornato utilizzando gli aggiornamenti di sistema
Google Play indipendentemente dalla release della piattaforma e stiamo supportando
queste modifiche per tornare ad Android 11 (livello API 30) creando una versione
compatibile pre-Android 15 della piattaforma API, denominata
PdfRendererPreV
.
Apprezziamo il tuo feedback sui miglioramenti che abbiamo apportato alla piattaforma API PdfRenderer
e prevediamo di rendere ancora più semplice l'integrazione di queste API nella tua app con una prossima libreria Android Jetpack.
Perfezionamenti al passaggio automatico della lingua
Android 14 added on-device, multi-language recognition in audio with automatic
switching between languages, but this can cause words to get dropped,
especially when languages switch with less of a pause between the two
utterances. Android 15 adds additional controls to help apps tune this switching
to their use case.
EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS
confines the automatic switching to the beginning of the audio session, while
EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES
deactivates the
language switching after a defined number of switches. These options are
particularly useful if you expect that there will be a single language spoken
during the session that should be autodetected.
Miglioramento dell'API OpenType Variable Font
Android 15 migliora l'usabilità del carattere variabile OpenType. Ora puoi creare un'istanza FontFamily
da un carattere variabile senza specificare gli assi di ponderazione utilizzando l'API buildVariableFamily
. Il renderer del testo sostituisce
il valore dell'asse wght
in modo che corrisponda al testo visualizzato.
Utilizzando la nuova API, questo semplifica il codice per la creazione di un elemento Typeface
in modo considerevole:
Kotlin
val newTypeface = Typeface.CustomFallbackBuilder( FontFamily.Builder( Font.Builder(assets, "RobotoFlex.ttf").build()) .buildVariableFamily()) .build()
Java
Typeface newTypeface = Typeface.CustomFallbackBuilder( new FontFamily.Builder( new Font.Builder(assets, "RobotoFlex.ttf").build()) .buildVariableFamily()) .build();
In precedenza, per creare lo stesso Typeface
, avevi bisogno di molto più codice:
Kotlin
val oldTypeface = Typeface.CustomFallbackBuilder( FontFamily.Builder( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 400") .setWeight(400) .build()) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 100") .setWeight(100) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 200") .setWeight(200) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 300") .setWeight(300) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 500") .setWeight(500) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 600") .setWeight(600) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 700") .setWeight(700) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 800") .setWeight(800) .build() ) .addFont( Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 900") .setWeight(900) .build() ).build() ).build()
Java
Typeface oldTypeface = new Typeface.CustomFallbackBuilder( new FontFamily.Builder( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 400") .setWeight(400) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 100") .setWeight(100) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 200") .setWeight(200) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 300") .setWeight(300) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 500") .setWeight(500) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 600") .setWeight(600) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 700") .setWeight(700) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 800") .setWeight(800) .build() ) .addFont( new Font.Builder(assets, "RobotoFlex.ttf") .setFontVariationSettings("'wght' 900") .setWeight(900) .build() ) .build() ).build();
Ecco un esempio di rendering di un elemento Typeface
creato con la vecchia e la nuova API:
In questo esempio, l'elemento Typeface
creato con l'API precedente non è in grado di
creare ponderazioni accurate dei caratteri per le istanze 350, 450, 550 e 650
Font
, per cui il renderer utilizza la ponderazione più vicina. Quindi, in questo caso, viene eseguito il rendering 300 anziché 350, 400 viene visualizzato invece di 450 e così via. Al contrario, l'elemento Typeface
creato con le nuove API crea dinamicamente un'istanza Font
per un determinato peso, in modo che venga eseguito il rendering anche di ponderazioni precise per 350, 450, 550 e 650.
Controlli granulari per interruzione di riga
Starting in Android 15, a TextView
and the underlying
line breaker can preserve the given portion of text in the same line to improve
readability. You can take advantage of this line break customization by using
the <nobreak>
tag in string resources or
createNoBreakSpan
. Similarly, you can preserve words from
hyphenation by using the <nohyphen>
tag or
createNoHyphenationSpan
.
For example, the following string resource doesn't include a line break, and renders with the text "Pixel 8 Pro." breaking in an undesirable place:
<resources>
<string name="pixel8pro">The power and brains behind Pixel 8 Pro.</string>
</resources>
In contrast, this string resource includes the <nobreak>
tag, which wraps the
phrase "Pixel 8 Pro." and prevents line breaks:
<resources>
<string name="pixel8pro">The power and brains behind <nobreak>Pixel 8 Pro.</nobreak></string>
</resources>
The difference in how these strings are rendered is shown in the following images:
![](https://developer.android.com/static/about/versions/15/images/line-breaks-none.png?authuser=7&hl=it)
<nobreak>
tag.![](https://developer.android.com/static/about/versions/15/images/line-breaks-included.png?authuser=7&hl=it)
<nobreak>
tag.Archiviazione delle app
Android and Google Play announced support for app archiving last year, allowing users to free up space by partially removing infrequently used apps from the device that were published using Android App Bundle on Google Play. Android 15 now includes OS level support for app archiving and unarchiving, making it easier for all app stores to implement it.
Apps with the REQUEST_DELETE_PACKAGES
permission can call the
PackageInstaller
requestArchive
method to request archiving an
installed app package, which removes the APK and any cached files, but persists
user data. Archived apps are returned as displayable apps through the
LauncherApps
APIs; users will see a UI treatment to highlight that those
apps are archived. If a user taps on an archived app, the responsible installer
will get a request to unarchive it, and the restoration process can be
monitored by the ACTION_PACKAGE_ADDED
broadcast.
Grafica
Android 15 introduce gli ultimi miglioramenti della grafica, tra cui ANGLE e le aggiunte al sistema grafico di Canvas.
Modernizzazione dell'accesso alle GPU di Android
Android hardware has evolved quite a bit from the early days where the core OS would run on a single CPU and GPUs were accessed using APIs based on fixed-function pipelines. The Vulkan® graphics API has been available in the NDK since Android 7.0 (API level 24) with a lower-level abstraction that better reflects modern GPU hardware, scales better to support multiple CPU cores, and offers reduced CPU driver overhead — leading to improved app performance. Vulkan is supported by all modern game engines.
Vulkan is Android's preferred interface to the GPU. Therefore, Android 15 includes ANGLE as an optional layer for running OpenGL® ES on top of Vulkan. Moving to ANGLE will standardize the Android OpenGL implementation for improved compatibility, and, in some cases, improved performance. You can test out your OpenGL ES app stability and performance with ANGLE by enabling the developer option in Settings -> System -> Developer Options -> Experimental: Enable ANGLE on Android 15.
The Android ANGLE on Vulkan roadmap
![Roadmap of upcoming changes to the Android GPU APIs.](https://developer.android.com/static/about/versions/15/images/angle-vulkan-roadmap.png?authuser=7&hl=it)
As part of streamlining our GPU stack, going forward we will be shipping ANGLE as the GL system driver on more new devices, with the future expectation that OpenGL/ES will be only available through ANGLE. That being said, we plan to continue support for OpenGL ES on all devices.
Recommended next steps
Use the developer options to select the ANGLE driver for OpenGL ES and test your app. For new projects, we strongly encourage using Vulkan for C/C++.
Miglioramenti per Canvas
Android 15 continues our modernization of Android's Canvas graphics system with new capabilities:
Matrix44
provides a 4x4 matrix for transforming coordinates that should be used when you want to manipulate the canvas in 3D.clipShader
intersects the current clip with the specified shader, whileclipOutShader
sets the clip to the difference of the current clip and the shader, each treating the shader as an alpha mask. This supports the drawing of complex shapes efficiently.
Prestazioni e batteria
Android si concentra sempre sull'aiutarti a migliorare le prestazioni e la qualità delle tue app. Android 15 introduce nuove API che aiutano a rendere più efficienti le attività nella tua app, a ottimizzarne le prestazioni e a raccogliere approfondimenti sulle tue app.
Per le best practice per l'efficienza energetica, il debug dell'utilizzo della rete e dell'alimentazione e i dettagli su come stiamo migliorando l'efficienza della batteria per il lavoro in background in Android 15 e nelle versioni recenti di Android, consulta la presentazione Migliorare l'efficienza della batteria del lavoro in background su Android da Google I/O.
API ApplicationStartInfo
In previous versions of Android, app startup has been a bit of a mystery. It was
challenging to determine within your app whether it started from a cold, warm,
or hot state. It was also difficult to know how long your app spent during the
various launch phases: forking the process, calling onCreate
, drawing the
first frame, and more. When your Application
class was instantiated, you had no
way of knowing whether the app started from a broadcast, a content provider, a
job, a backup, boot complete, an alarm, or an Activity
.
The ApplicationStartInfo
API on Android 15 provides
all of this and more. You can even choose to add your own timestamps into the
flow to help collect timing data in one place. In addition to collecting
metrics, you can use ApplicationStartInfo
to help directly optimize app
startup; for example, you can eliminate the costly instantiation of UI-related
libraries within your Application
class when your app is starting up due to a
broadcast.
Informazioni dettagliate sulle dimensioni dell'app
Since Android 8.0 (API level 26), Android has included the
StorageStats.getAppBytes
API that summarizes the installed
size of an app as a single number of bytes, which is a sum of the APK size, the
size of files extracted from the APK, and files that were generated on the
device such as ahead-of-time (AOT) compiled code. This number is not very
insightful in terms of how your app is using storage.
Android 15 adds the
StorageStats.getAppBytesByDataType([type])
API, which lets
you get insight into how your app is using up all that space, including APK file
splits, AOT and speedup related code, dex metadata, libraries, and guided
profiles.
Profilazione gestita dall'app
Android 15 include la nuovissima classe ProfilingManager
, che ti consente di
raccogliere le informazioni di profilazione dalla tua app. Prevediamo di includere questa
API Android Jetpack che semplificherà la creazione delle richieste di profilazione,
ma l'API di base consentirà la raccolta di dump dell'heap, profili
heap, campionamento dello stack e altro ancora. Fornisce un callback alla tua app con un tag fornito per identificare il file di output, che viene inviato nella directory dei file dell'app. L'API limita la frequenza per minimizzare l'impatto sulle prestazioni.
Miglioramenti al database SQLite
Android 15 introduce nuove API SQLite che espongono funzionalità avanzate dal motore SQLite sottostante che hanno come target specifici problemi di prestazioni che possono manifestarsi nelle app.
Gli sviluppatori possono consultare le best practice per le prestazioni SQLite per ottenere il massimo dal loro database SQLite, soprattutto quando si lavora con database di grandi dimensioni o durante l'esecuzione di query sensibili alla latenza.
- Transazioni differite di sola lettura: se emetti transazioni di sola lettura (non includono istruzioni di scrittura), utilizza
beginTransactionReadOnly()
ebeginTransactionWithListenerReadOnly(SQLiteTransactionListener)
per emettere transazioniDEFERRED
di sola lettura. Queste transazioni possono essere eseguite contemporaneamente e, se il database è in modalità WAL, possono essere eseguite contemporaneamente alle transazioniIMMEDIATE
oEXCLUSIVE
. - Conteggi e ID righe: sono state aggiunte nuove API per recuperare il conteggio delle righe modificate o l'ultimo ID riga inserito senza inviare un'altra query.
getLastChangedRowCount()
restituisce il numero di righe che sono state inserite, aggiornate o eliminate dall'istruzione SQL più recente nella transazione corrente, mentregetTotalChangedRowCount()
restituisce il conteggio sulla connessione corrente.getLastInsertRowId()
restituisce il valorerowid
dell'ultima riga da inserire nella connessione corrente. - Istruzioni non elaborate: emettono un'istruzione SQlite non elaborata, ignorando i wrapper di convenienza e qualsiasi altro sovraccarico di elaborazione.
Aggiornamenti di Android Dynamic Performance Framework
Android 15 continua il nostro investimento nell'Android Dynamic Performance Framework (ADPF), un insieme di API che consentono a giochi e app che richiedono prestazioni elevate di interagire in modo più diretto con i sistemi di alimentazione e termici dei dispositivi Android. Sui dispositivi supportati, Android 15 aggiungerà nuove funzionalità ADPF:
- Una modalità di efficienza energetica per le sessioni di suggerimento che indicano che i thread associati dovrebbero preferire il risparmio energetico rispetto alle prestazioni, ottimo per carichi di lavoro in background a lunga esecuzione.
- Le durate di lavoro di GPU e CPU possono essere registrate nelle sessioni hint, consentendo al sistema di regolare insieme le frequenze di CPU e GPU per soddisfare al meglio le esigenze dei carichi di lavoro.
- Soglie di margine termico per interpretare il possibile stato di limitazione termica in base al margine di errore.
Per scoprire di più su come utilizzare l'DPF nelle tue app e nei tuoi giochi, consulta la documentazione.
Privacy
Android 15 include una serie di funzionalità che aiutano gli sviluppatori di app a proteggere la privacy degli utenti.
Rilevamento Registrazione dello schermo
Android 15 aggiunge il supporto per le app per rilevare che vengono registrate. Viene richiamato ogni volta che l'app passa da essere visibile a invisibile all'interno di una registrazione dello schermo. Un'app è considerata visibile se vengono registrate attività di proprietà dell'UID del processo di registrazione. In questo modo, se la tua app sta eseguendo un'operazione sensibile, puoi comunicare all'utente che l'operazione è stata registrata.
val mCallback = Consumer<Int> { state ->
if (state == SCREEN_RECORDING_STATE_VISIBLE) {
// We're being recorded
} else {
// We're not being recorded
}
}
override fun onStart() {
super.onStart()
val initialState =
windowManager.addScreenRecordingCallback(mainExecutor, mCallback)
mCallback.accept(initialState)
}
override fun onStop() {
super.onStop()
windowManager.removeScreenRecordingCallback(mCallback)
}
Funzionalità IntentFilter estese
Android 15 supporta una risoluzione Intent
più precisa tramite UriRelativeFilterGroup
, che contiene un insieme di oggetti UriRelativeFilter
che formano un insieme di regole di corrispondenza Intent
che devono essere soddisfatte singolarmente, inclusi i parametri di query dell'URL, i frammenti di URL e le regole di blocco o di esclusione.
Queste regole possono essere definite nel file XML AndroidManifest
con il nuovo tag <uri-relative-filter-group>
, che può facoltativamente includere un tag android:allow
. Questi tag possono contenere tag <data>
che utilizzano attributi di tag dati
esistenti, nonché i nuovi attributi android:query
e android:fragment
.
Ecco un esempio della sintassi AndroidManifest
:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:domain="astore.com" />
<uri-relative-filter-group>
<data android:pathPrefix="/auth" />
<data android:query="region=na" />
</uri-relative-filter-group>
<uri-relative-filter-group android:allow="false">
<data android:pathPrefix="/auth" />
<data android:query="mobileoptout=true" />
</uri-relative-filter-group>
<uri-relative-filter-group android:allow="false">
<data android:pathPrefix="/auth" />
<data android:fragmentPrefix="faq" />
</uri-relative-filter-group>
</intent-filter>
Spazio privato
Private space lets users create a separate space on their device where they can keep sensitive apps away from prying eyes, under an additional layer of authentication. The private space uses a separate user profile. The user can choose to use the device lock or a separate lock factor for the private space.
Apps in the private space show up in a separate container in the launcher, and are hidden from the recents view, notifications, settings, and from other apps when the private space is locked. User-generated and downloaded content (such as media or files) and accounts are separated between the private space and the main space. The system sharesheet and the photo picker can be used to give apps access to content across spaces when the private space is unlocked.
Users can't move existing apps and their data into the private space. Instead, users select an install option in the private space to install an app using whichever app store they prefer. Apps in the private space are installed as separate copies from any apps in the main space (new copies of the same app).
When a user locks the private space, the profile is stopped. While the profile is stopped, apps in the private space are no longer active and can't perform foreground or background activities, including showing notifications.
We recommend that you test your app with private space to make sure your app works as expected, especially if your app falls into one of the following categories:
- Apps with logic for work profiles that assumes that any installed copies of their app that aren't in the main profile are in the work profile.
- Launcher apps
- App store apps
Esegui una query sulla selezione utente più recente per l'accesso alle foto selezionate
It is now possible for apps to highlight only the most recently selected photos
and videos when partial access to media permissions is granted. This
feature can improve the user experience for apps that frequently request
access to photos and videos. To use this feature in your app, enable the
QUERY_ARG_LATEST_SELECTION_ONLY
argument when querying MediaStore
through ContentResolver
.
Kotlin
val externalContentUri = MediaStore.Files.getContentUri("external") val mediaColumns = arrayOf( FileColumns._ID, FileColumns.DISPLAY_NAME, FileColumns.MIME_TYPE, ) val queryArgs = bundleOf( // Return only items from the last selection (selected photos access) QUERY_ARG_LATEST_SELECTION_ONLY to true, // Sort returned items chronologically based on when they were added to the device'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() ) )
Java
Uri externalContentUri = MediaStore.Files.getContentUri("external"); String[] mediaColumns = { FileColumns._ID, FileColumns.DISPLAY_NAME, FileColumns.MIME_TYPE }; Bundle queryArgs = new Bundle(); queryArgs.putBoolean(MediaStore.QUERY_ARG_LATEST_SELECTION_ONLY, true); queryArgs.putString(MediaStore.QUERY_ARG_SQL_SORT_ORDER, FileColumns.DATE_ADDED + " DESC"); queryArgs.putString(MediaStore.QUERY_ARG_SQL_SELECTION, FileColumns.MEDIA_TYPE + " = ? OR " + FileColumns.MEDIA_TYPE + " = ?"); queryArgs.putStringArray(MediaStore.QUERY_ARG_SQL_SELECTION_ARGS, new String[] { String.valueOf(FileColumns.MEDIA_TYPE_IMAGE), String.valueOf(FileColumns.MEDIA_TYPE_VIDEO) });
Privacy Sandbox su Android
Android 15 include le ultime estensioni dei servizi pubblicitari Android, che incorporano la versione più recente di Privacy Sandbox su Android. Questa aggiunta fa parte del nostro lavoro di sviluppo di nuove tecnologie che migliorino la privacy degli utenti e consentano esperienze pubblicitarie efficaci e personalizzate per le app mobile. La nostra pagina Privacy Sandbox contiene ulteriori informazioni sui programmi Anteprima e beta di Privacy Sandbox su Android per aiutarti a iniziare.
Connessione Salute
Android 15 integrates the latest extensions around Health Connect by Android, a secure and centralized platform to manage and share app-collected health and fitness data. This update adds support for new data types across fitness, nutrition, skin temperature, training plans, and more.
Skin temperature tracking allows users to store and share more accurate temperature data from a wearable or other tracking device.
Training plans are structured workout plans to help a user achieve their fitness goals. Training plans support includes a variety of completion and performance goals:
- Completion goals around calories burned, distance, duration, repetition, and steps.
- Performance goals around as many repetitions as possible (AMRAP), cadence, heart rate, power, perceived rate of exertion, and speed.
Learn more about the latest updates to Health Connect in Android in the Building adaptable experiences with Android Health talk from Google I/O.
Condivisione schermo parziale
Android 15 supports partial screen sharing so users can share or record just an
app window rather than the entire device screen. This feature, first enabled in
Android 14 QPR2, includes
MediaProjection
callbacks that allow your app
to customize the partial screen sharing experience. Note that for apps targeting
Android 14 (API level 34) or higher,
user consent is now required for each
MediaProjection
capture session.
Esperienza utente e UI di sistema
Android 15 offre a sviluppatori di app e utenti più controllo e flessibilità per configurare il proprio dispositivo in base alle loro esigenze.
Per scoprire di più su come utilizzare gli ultimi miglioramenti in Android 15 per migliorare l'esperienza utente della tua app, leggi la conversazione Migliorare l'esperienza utente dell'app per Android di Google I/O.
Anteprime del widget più approfondite con l'API Generated Previews
Before Android 15, the only way to provide widget picker previews was to specify a static image or layout resource. These previews often differ significantly from the look of the actual widget when it is placed on the home screen. Also, static resources can't be created with Jetpack Glance, so a Glance developer had to screenshot their widget or create an XML layout to have a widget preview.
Android 15 adds support for generated previews. This means that app widget
providers can generate RemoteViews
to use as the picker preview, instead
of a static resource.
![](https://developer.android.com/static/about/versions/15/images/generated-previews.png?authuser=7&hl=it)
Push API
Apps can provide generated previews through a push API. Apps can provide
previews at any point in their lifecycle, and don't receive an explicit request
from the host to provide previews. Previews are persisted in AppWidgetService
,
and hosts can request them on-demand. The following example loads an XML widget
layout resource and sets it as the preview:
AppWidgetManager.getInstance(appContext).setWidgetPreview(
ComponentName(
appContext,
SociaLiteAppWidgetReceiver::class.java
),
AppWidgetProviderInfo.WIDGET_CATEGORY_HOME_SCREEN,
RemoteViews("com.example", R.layout.widget_preview)
)
The expected flow is:
- At any time, the widget provider calls
setWidgetPreview
. The provided previews are persisted inAppWidgetService
with other provider info. setWidgetPreview
notifies hosts of an updated preview through theAppWidgetHost.onProvidersChanged
callback. In response, the widget host reloads all of its provider information.- When displaying a widget preview, the host checks
AppWidgetProviderInfo.generatedPreviewCategories
, and if the chosen category is available, callsAppWidgetManager.getWidgetPreview
to return the saved preview for this provider.
When to call setWidgetPreview
Because there is no callback to provide previews, apps can choose to send previews at any point when they are running. How often to update the preview depends on the widget's use case.
The following list describes the two main categories of preview use cases:
- Providers that show real data in their widget previews, such as personalized or recent information. These providers can set the preview once the user has signed in or has done initial configuration in their app. After this, they can set up a periodic task to update the previews at their chosen cadence. Examples of this type of widget could be a photo, calendar, weather or news widget.
- Providers that show static information in previews or quick-action widgets that don't display any data. These providers can set previews once, when the app first launches. Examples of this type of widget include a drive quick actions widget or chrome shortcuts widget.
Some providers might show static previews on the hub mode picker, but real information on the homescreen picker. These providers should follow the guidance for both of these use cases to set previews.
Picture in picture
Android 15 introduces new changes in Picture-in-Picture (PiP) ensuring an even smoother transition when entering into PiP mode. This will be beneficial for apps having UI elements overlaid on top of their main UI, which goes into PiP.
Developers use the onPictureInPictureModeChanged
callback to define logic
that toggles the visibility of the overlaid UI elements. This callback is
triggered when the PiP enter or exit animation is completed. Beginning in
Android 15, the PictureInPictureUiState
class includes a new state.
With this new UI state, apps targeting Android 15 will observe the
Activity#onPictureInPictureUiStateChanged
callback being invoked with
isTransitioningToPip()
as soon as the PiP animation starts. There are
many UI elements that are not relevant for the app when it is in PiP mode, for
example views or layout that include information such as suggestions, upcoming
video, ratings, and titles. When the app goes to PiP mode, use the
onPictureInPictureUiStateChanged
callback to hide these UI elements. When the
app goes to full screen mode from the PiP window, use
onPictureInPictureModeChanged
callback to unhide these elements, as shown in
the following examples:
override fun onPictureInPictureUiStateChanged(pipState: PictureInPictureUiState) {
if (pipState.isTransitioningToPip()) {
// Hide UI elements
}
}
override fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean) {
if (isInPictureInPictureMode) {
// Unhide UI elements
}
}
This quick visibility toggle of irrelevant UI elements (for a PiP window) helps ensure a smoother and flicker-free PiP enter animation.
Regole Non disturbare migliorate
AutomaticZenRule
consente alle app di personalizzare le regole di Gestione dell'attenzione (non disturbare) e di decidere quando attivarle o disattivarle. Android 15 migliora notevolmente queste regole con l'obiettivo di migliorare l'esperienza utente. Sono inclusi i seguenti miglioramenti:
- L'aggiunta di tipi a
AutomaticZenRule
consente al sistema di applicare un trattamento speciale ad alcune regole. - L'aggiunta di un'icona a
AutomaticZenRule
consente di rendere più riconoscibili le modalità. - Aggiunta a
AutomaticZenRule
di una stringatriggerDescription
che descriva le condizioni in base alle quali la regola deve diventare attiva per l'utente. - Aggiunta di
ZenDeviceEffects
aAutomaticZenRule
per consentire alle regole di attivare, ad esempio, la visualizzazione in scala di grigi, la modalità notturna o l'oscuramento dello sfondo.
Impostare l'effetto VibrationEffect per i canali di notifica
Android 15 supporta l'impostazione di vibrazioni avanzate per le notifiche in arrivo per canale utilizzando NotificationChannel.setVibrationEffect
, in modo che gli utenti possano distinguere tra i diversi tipi di notifica senza dover guardare il dispositivo.
Schermi e fattori di forma grandi
Android 15 offre alle tue app il supporto per ottenere il massimo dai fattori di forma di Android, tra cui schermi di grandi dimensioni, convertibili e pieghevoli.
Multitasking migliorato su schermi di grandi dimensioni
Android 15 gives users better ways to multitask on large screen devices. For example, users can save their favorite split-screen app combinations for quick access and pin the taskbar on screen to quickly switch between apps. This means that making sure your app is adaptive is more important than ever.
Google I/O has sessions on Building adaptive Android apps and Building UI with the Material 3 adaptive library that can help, and our documentation has more to help you Design for large screens.
Supporto per schermo di copertura
La tua app può dichiarare una proprietà utilizzata da Android 15 per
consentire la visualizzazione di Application
o Activity
sulle piccole schermate di copertina dei dispositivi ribaltabili supportati. Queste schermate sono troppo piccole per essere
considerate target compatibili per l'esecuzione delle app per Android, ma la tua app può
attivarne il supporto, rendendo l'app disponibile in più luoghi.
Connettività
Android 15 aggiorna la piattaforma per consentire alla tua app di accedere agli ultimi progressi nelle tecnologie di comunicazione e wireless.
Supporto satellite
Android 15 continues to extend platform support for satellite connectivity and includes some UI elements to ensure a consistent user experience across the satellite connectivity landscape.
Apps can use ServiceState.isUsingNonTerrestrialNetwork()
to
detect when a device is connected to a satellite, giving them more awareness of
why full network services might be unavailable. Additionally, Android 15
provides support for SMS and MMS apps as well as preloaded RCS apps to use
satellite connectivity for sending and receiving messages.
![](https://developer.android.com/static/about/versions/15/images/satellite-notification.png?authuser=7&hl=it)
Esperienze NFC più fluide
Android 15 is working to make the tap to pay experience more seamless and
reliable while continuing to support Android's robust NFC app ecosystem. On
supported devices, apps can request the NfcAdapter
to enter
observe mode, where the device listens but doesn't respond to NFC
readers, sending the app's NFC service PollingFrame
objects to process. The PollingFrame
objects can be used to auth
ahead of the first communication to the NFC reader, allowing for a one tap
transaction in many cases.
In addition, apps can now register a filter on supported devices so they can be notified of polling loop activity, which allows for smooth operation with multiple NFC-aware applications.
Ruolo Wallet
Android 15 introduce un nuovo ruolo Wallet che consente una maggiore integrazione con l'app Wallet preferita dell'utente. Questo ruolo sostituisce l'impostazione di pagamento contactless predefinita NFC. Gli utenti possono gestire il titolare del ruolo Wallet andando a Impostazioni > App > App predefinite.
Il ruolo Wallet viene utilizzato per il routing dei tocchi NFC per gli AID registrati nella categoria di pagamento. I tocchi vanno sempre al titolare del ruolo di Wallet, a meno che in primo piano non sia in esecuzione un'altra app registrata per lo stesso AID.
Questo ruolo viene utilizzato anche per determinare dove deve essere inserito il riquadro QuickAccess di Wallet quando viene attivato. Se il ruolo è impostato su "Nessuno", il riquadro QuickAccess non è disponibile e i tocchi NFC della categoria di pagamento vengono inviati solo all'app in primo piano.
Sicurezza
Android 15 ti aiuta a migliorare la sicurezza della tua app, a proteggere i dati dell'app e offre agli utenti maggiore trasparenza e controllo sui loro dati. Leggi la conversazione sulla protezione degli utenti su Android di Google I/O per scoprire di più su cosa stiamo facendo per migliorare le misure di salvaguardia degli utenti e proteggere la tua app da nuove minacce.
Integrare Gestore delle credenziali con la compilazione automatica
Starting with Android 15, developers can link specific views like username or password fields with Credential Manager requests, making it easier to provide a tailored user experience during the sign-in process. When the user focuses on one of these views, a corresponding request is sent to Credential Manager. The resulting credentials are aggregated across providers and displayed in autofill fallback UIs, such as inline suggestions or drop-down suggestions. The Jetpack androidx.credentials library is the preferred endpoint for developers to use and will soon be available to further enhance this feature in Android 15 and higher.
Integra la registrazione Single Tap e l'accesso con richieste biometriche
Credential Manager integrates biometric prompts into the credential creation and sign-in processes, eliminating the need for providers to manage biometric prompts. As a result, credential providers only need to focus on the results of the create and get flows, augmented with the biometric flow result. This simplified process creates a more efficient and streamlined credential creation and retrieval process.
Gestione delle chiavi per la crittografia end-to-end
Stiamo introducendo E2eeContactKeysManager
in Android 15, che
semplifica la crittografia end-to-end (E2EE) nelle tue app Android fornendo
un'API a livello di sistema operativo per l'archiviazione di chiavi pubbliche crittografiche.
E2eeContactKeysManager
è progettato per integrarsi con l'app dei contatti della piattaforma per offrire agli utenti un modo centralizzato per gestire e verificare le chiavi pubbliche dei loro contatti.
Controlli delle autorizzazioni sugli URI dei contenuti
Android 15 introduces a new set of APIs that perform permission checks on content URIs:
Context.checkContentUriPermissionFull
: This performs a full permission check on content URIs.Activity
manifest attributerequireContentUriPermissionFromCaller
: This enforces specified permissions on the provided content URIs at activity launch.ComponentCaller
class forActivity
callers: This represents the app that launched the activity.
Accessibilità
Android 15 aggiunge funzionalità che migliorano l'accessibilità per gli utenti.
Braille avanzato
In Android 15, abbiamo consentito a TalkBack di supportare i display braille che utilizzano lo standard HID sia tramite USB che tramite Bluetooth sicuro.
Questo standard, simile a quello utilizzato per mouse e tastiere, consentirà ad Android di supportare una gamma più ampia di display braille con il passare del tempo.
Internazionalizzazione
Android 15 aggiunge funzionalità e caratteristiche che completano l'esperienza utente quando un dispositivo viene utilizzato in lingue diverse.
Carattere variabile CJK
Starting with Android 15, the font file for Chinese, Japanese, and Korean (CJK) languages, NotoSansCJK, is now a variable font. Variable fonts open up new possibilities for creative typography in CJK languages. Designers can explore a broader range of styles and create visually striking layouts that were previously difficult or impossible to achieve.
![](https://developer.android.com/static/about/versions/15/images/cjk-variable-font.png?authuser=7&hl=it)
Motivazione tra caratteri
A partire da Android 15, il testo può essere giustificato utilizzando la spaziatura tra le lettere utilizzando JUSTIFICATION_MODE_INTER_CHARACTER
. La giustificazione tra parole è stata introdotta per la prima volta in Android 8.0 (livello API 26) e la giustificazione tra caratteri offre funzionalità simili per le lingue che utilizzano lo spazio vuoto per la segmentazione, ad esempio cinese, giapponese e altri.
![](https://developer.android.com/static/about/versions/15/images/none-japanese.png?authuser=7&hl=it)
JUSTIFICATION_MODE_NONE
.![](https://developer.android.com/static/about/versions/15/images/none-english.png?authuser=7&hl=it)
JUSTIFICATION_MODE_NONE
.![](https://developer.android.com/static/about/versions/15/images/inter-word-japanese.png?authuser=7&hl=it)
JUSTIFICATION_MODE_INTER_WORD
.![](https://developer.android.com/static/about/versions/15/images/inter-word-english.png?authuser=7&hl=it)
JUSTIFICATION_MODE_INTER_WORD
.![](https://developer.android.com/static/about/versions/15/images/inter-character-japanese.png?authuser=7&hl=it)
JUSTIFICATION_MODE_INTER_CHARACTER
.![](https://developer.android.com/static/about/versions/15/images/inter-character-english.png?authuser=7&hl=it)
JUSTIFICATION_MODE_INTER_CHARACTER
.Configurazione automatica dell'interruzione di riga
Android ha iniziato a supportare le interruzioni di riga basate su frasi per il giapponese e il coreano in
Android 13 (livello API 33). Tuttavia, anche se le interruzioni di riga basate su frasi migliorano la leggibilità di righe di testo brevi, non funzionano bene per le righe di testo lunghe.
In Android 15, le app ora possono applicare interruzioni di riga basate a frase solo per brevi righe di testo, utilizzando l'opzione LINE_BREAK_WORD_STYLE_AUTO
. Questa opzione consente di selezionare lo stile delle parole migliore per il testo.
Per brevi righe di testo, vengono utilizzate interruzioni di riga basate su frase, che funzionano come LINE_BREAK_WORD_STYLE_PHRASE
, come mostrato nell'immagine seguente:
![](https://developer.android.com/static/about/versions/15/images/line-break-auto-short.png?authuser=7&hl=it)
LINE_BREAK_WORD_STYLE_AUTO
applica interruzioni di riga basate su frase per migliorare la leggibilità del testo.
Equivale all'applicazione di
LINE_BREAK_WORD_STYLE_PHRASE
.Per righe di testo più lunghe, LINE_BREAK_WORD_STYLE_AUTO
utilizza uno
stile di parole senza interruzioni, che funziona come
LINE_BREAK_WORD_STYLE_NONE
, come mostrato nella
seguente immagine:
![](https://developer.android.com/static/about/versions/15/images/line-break-auto-long.png?authuser=7&hl=it)
LINE_BREAK_WORD_STYLE_AUTO
applica uno stile di parola senza interruzioni per migliorare la leggibilità del testo.
Equivale all'applicazione di
LINE_BREAK_WORD_STYLE_NONE
.Nuovo carattere Hentaigana giapponese
In Android 15, per impostazione predefinita viene raggruppato un nuovo file dei caratteri per la vecchia versione giapponese Hiragana (nota come Hentaigana). Le forme uniche dei personaggi Hentaigana possono conferire un tocco distintivo all'opera d'arte o al design, aiutando al contempo a preservare la trasmissione accurata e la comprensione degli antichi documenti giapponesi.
![](https://developer.android.com/static/about/versions/15/images/hentaigana-font.png?authuser=7&hl=it)
Cono VideoLAN Copyright (c) 1996-2010 VideoLAN. Questo logo o una versione modificata possono essere utilizzati o modificati da chiunque per fare riferimento al progetto VideoLAN o a qualsiasi prodotto sviluppato dal team VideoLAN, ma non implica alcuna approvazione da parte del progetto.
Vulkan e il logo Vulkan sono marchi registrati di Khronos Group Inc.
OpenGL è un marchio registrato e il logo OpenGL ES è un marchio di Hewlett Packard Enterprise utilizzato su autorizzazione di Khronos.