Panoramica delle funzionalità e delle API

Android 15 introduce fantastiche funzionalità e API per gli sviluppatori. Le sezioni seguenti riassumono queste funzionalità per aiutarti a iniziare a utilizzare le API correlate.

Per un elenco dettagliato delle API aggiunte, modificate e rimosse, consulta il report sulle differenze tra le API. Per i dettagli sulle API aggiunte, visita il riferimento API Android. Per Android 15, cerca le API aggiunte nel livello API 35. Per scoprire le aree in cui le modifiche della piattaforma potrebbero influire sulle tue app, assicurati di consultare le modifiche al comportamento di Android 15 per le app che hanno come target Android 15 e per tutte le app.

Fotocamera e contenuti multimediali

Android 15 include una serie di funzionalità che migliorano l'esperienza con la fotocamera e i contenuti multimediali e che ti danno accesso a strumenti e hardware per aiutare i creator a dare vita alla loro visione su Android.

Per saperne di più sulle ultime funzionalità e soluzioni per sviluppatori per i contenuti multimediali e la fotocamera di Android, guarda il talk Creare esperienze moderne con contenuti multimediali e fotocamera su Android di Google I/O.

Aumento luce

Android 15 introduce la funzionalità Low Light Boost, una modalità di esposizione automatica disponibile sia per Camera 2 sia per l'estensione della fotocamera con modalità notturna. Il potenziamento automatico regola l'esposizione dello stream di anteprima in condizioni di scarsa illuminazione. Questo è diverso da come l'estensione della fotocamera in modalità Notte crea immagini fisse, perché la modalità Notte combina una raffica di foto per creare un'unica immagine migliorata. Sebbene la modalità notturna sia molto efficace per creare un'immagine fissa, non può creare uno stream continuo di fotogrammi, ma lo può fare il miglioramento in condizioni di scarsa illuminazione. Pertanto, il miglioramento in condizioni di scarsa illuminazione consente di attivare le funzionalità della fotocamera, ad esempio:

  • Fornire un'anteprima dell'immagine migliorata, in modo che gli utenti possano inquadrare meglio le foto in condizioni di scarsa illuminazione
  • Scansione di codici QR in condizioni di scarsa illuminazione

Se attivi l'opzione Luce notturna, questa si attiva automaticamente quando il livello di illuminazione è basso e si disattiva quando c'è più luce.

Le app possono registrare l'anteprima stream quando la luce è bassa in modo che il video salvato sia più luminoso.

Per saperne di più, consulta Aumento luminosità in condizioni di scarsa illuminazione.

Controlli della fotocamera in-app

Android 15 adds an 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 and TORCH 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.

The brightness of SDR UI elements on the left screen appears to be more uniform than the brightness on the right screen, which simulates possible headroom issues when HDR and SDR content are mixed. By adjusting the HDR headroom, you can achieve a better balance between the SDR and HDR content.

Controllo del volume

Android 15 introduce il supporto per Standard per il volume CTA-2075 per aiutarti evitare incoerenze del volume audio e fare in modo che gli utenti non debbano controllare regolare il volume passando da un contenuto all'altro. Il sistema sfrutta le note alle caratteristiche dei dispositivi di uscita (cuffie e altoparlanti) insieme metadati del volume disponibili nei contenuti audio AAC per regolare in modo intelligente il volume audio e livelli di compressione dell'intervallo dinamico.

Per attivare questa funzionalità, devi assicurarti che i metadati relativi all'intensità siano disponibili nei contenuti AAC e attivare la funzionalità della piattaforma nella tua app. Per farlo, devi creare un oggetto LoudnessCodecController chiamando il relativo metodo di fabbrica create con l'ID sessione audio dell'elemento AudioTrack associato. In questo modo, inizieranno automaticamente ad applicarsi gli aggiornamenti audio. Puoi trasmettere un OnLoudnessCodecUpdateListener per modificare o filtrare i parametri di volume prima di essere applicati 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
}

Anche ExoPlayer di AndroidX media3 verrà aggiornato per utilizzare le API LoudnessCodecController per un'integrazione perfetta delle app.

Dispositivi MIDI virtuali 2.0

Android 13 added support for connecting to MIDI 2.0 devices using USB, which communicate using Universal MIDI Packets (UMP). Android 15 extends UMP support to virtual MIDI apps, enabling composition apps to control synthesizer apps as a virtual MIDI 2.0 device just like they would with an USB MIDI 2.0 device.

Decodifica software AV1 più efficiente

dav1d logo

dav1d, the popular AV1 software decoder from VideoLAN is 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.

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 gli sviluppatori

Sebbene la maggior parte del nostro lavoro per migliorare la tua produttività si concentri su strumenti come Android Studio, Jetpack Compose e le librerie Android Jetpack , cerchiamo sempre modi per aiutarti a realizzare più facilmente la tua visione sulla piattaforma.

Aggiornamenti di OpenJDK 17

Android 15 continua il lavoro di aggiornamento delle librerie di base di Android per allinearsi alle funzionalità delle ultime release LTS di OpenJDK.

Sono incluse le seguenti funzionalità e i seguenti miglioramenti principali:

Queste API vengono aggiornate su oltre un miliardo di dispositivi con Android 12 (livello API 31) o versioni successive tramite gli aggiornamenti di sistema di Google Play, in modo da poter scegliere come target le ultime funzionalità di programmazione.

Miglioramenti dei PDF

Android 15 include miglioramenti sostanziali a PdfRenderer su quelle di livello inferiore. Le app possono incorporare funzionalità avanzate come il rendering file protetti da password, annotazioni, modifica di moduli, ricerca e selezione con testo. Sono supportate le ottimizzazioni dei PDF linearizzati per velocizzare la visualizzazione dei PDF locali e ridurre l'utilizzo delle risorse. La libreria Jetpack PDF utilizza queste API per semplificare l'aggiunta di file PDF funzionalità di visualizzazione per la tua app.

Gli ultimi aggiornamenti al rendering PDF includono funzionalità come la ricerca in un file PDF incorporato.

PdfRenderer è stato spostato in un modulo che può essere aggiornato utilizzando gli aggiornamenti di sistema di Google Play indipendentemente dalla release della piattaforma e supportiamo queste modifiche fino ad Android 11 (livello API 30) creando una versione compatibile pre-Android 15 dell'API, chiamata PdfRendererPreV.

Perfezionamenti del cambio di lingua automatico

Android 14 ha aggiunto il riconoscimento multilingue on-device nell'audio con il passaggio automatico tra le lingue, ma questo può causare l'eliminazione di parole, soprattutto quando le lingue cambiano con una pausa minore tra le due frasi. Android 15 aggiunge controlli aggiuntivi per aiutare le app a ottimizzare questo passaggio in base al loro caso d'uso. EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS limita il passaggio automatico all'inizio della sessione audio, mentre EXTRA_LANGUAGE_SWITCH_MATCH_SWITCHES disattiva il passaggio di lingua dopo un numero definito di passaggi. Queste opzioni sono particolarmente utili se prevedi che durante la sessione verrà parlata una sola lingua che deve essere rilevata automaticamente.

API OpenType Variable Font migliorata

Android 15 migliora l'usabilità dei caratteri variabili OpenType. Puoi creare un'istanza FontFamily da un carattere variabile senza specificare gli assi di spessore con l'API buildVariableFamily. Il renderer di testo sostituisce il valore su wght asse per corrispondere al testo visualizzato.

L'utilizzo dell'API semplifica notevolmente il codice per la creazione di una Typeface:

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, era necessario 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();

Di seguito è riportato un esempio di come viene visualizzato un Typeface creato sia con le API precedenti sia con quelle nuove:

Un esempio di come differisce il rendering dei caratteri tipografici usando i dati vecchi e nuovi
API

In questo esempio, il Typeface creato con l'API precedente non ha il valore capacità di creare spessori di carattere precisi per i modelli 350, 450, 550 e 650 Font, quindi il renderer torna al peso più vicino. Quindi In questo caso, viene eseguito il rendering di 300 anziché 350, di 400 invece di 450 e così via. Al contrario, l'elemento Typeface creato con le nuove API crea in modo dinamico un'istanza Font per un determinato peso, in modo che le ponderazioni siano accurate per 350, 450, 550 e 650.

Controlli granulari dell'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:

Layout for a line of text where the phrase "Pixel 8 Pro." isn't wrapped using a <nobreak> tag.
Layout for the same line of text where the phrase "Pixel 8 Pro." is wrapped using a <nobreak> tag.

Archiviazione 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 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.

Attivare la modalità a 16 kB su un dispositivo utilizzando le opzioni sviluppatore

Attiva l'opzione per sviluppatori Avvia con dimensione pagina 16 kB per avviare un dispositivo in modalità a 16 kB.

Nelle versioni QPR di Android 15, puoi utilizzare l'opzione sviluppatore disponibile su alcuni dispositivi per avviare il dispositivo in modalità 16 KB ed eseguire test sul dispositivo. Prima di utilizzare l'opzione sviluppatore, vai a Impostazioni > Sistema > Aggiornamenti software e applica gli aggiornamenti disponibili.

Questa opzione per sviluppatori è disponibile sui seguenti dispositivi:

  • Pixel 8 e 8 Pro (con Android 15 QPR1 o versioni successive)

  • Pixel 8a (con Android 15 QPR1 o versioni successive)

  • Pixel 9, 9 Pro e 9 Pro XL (con Android 15 QPR2 o versioni successive)

  • Pixel 9a (con Android 16 o versioni successive)

Grafica

Android 15 offre i più recenti miglioramenti grafici, tra cui ANGLE e aggiunte al sistema grafico Canvas.

Modernizzazione dell'accesso alla GPU di Android

Vulkan logo

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.

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 continua la nostra modernizzazione del sistema grafico Canvas di Android con funzionalità aggiuntive:

  • Matrix44 fornisce una matrice 4x4 per la trasformazione delle coordinate da utilizzare quando vuoi manipolare la tela in 3D.
  • clipShader interseca il clip corrente con lo shader specificato, mentre clipOutShader imposta il clip sulla differenza tra il clip corrente e lo shader, trattando ciascuno lo shader come una maschera alfa. Ciò consente di disegnare in modo efficiente forme complesse.

Prestazioni e batteria

Android continua a concentrarsi sull'aiutarti a migliorare le prestazioni e la qualità delle tue app. Android 15 introduce API che aiutano a rendere più efficienti le attività nella tua app, a ottimizzare le prestazioni dell'app e a raccogliere approfondimenti sulle tue app.

Per le best practice per l'efficienza della batteria, il debug dell'utilizzo della rete e dell'alimentazione e i dettagli su come stiamo migliorando l'efficienza della batteria del lavoro in background in Android 15 e nelle versioni recenti di Android, guarda il talk Migliorare l'efficienza della batteria del lavoro in background su Android di 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

Da Android 8.0 (livello API 26), Android include l'API StorageStats.getAppBytes che riassume le dimensioni installate di un'app come un singolo numero di byte, ovvero la somma delle dimensioni dell'APK, delle dimensioni dei file estratti dall'APK e dei file generati sul dispositivo, come il codice compilato in anticipo (AOT). Questo numero non è molto utile per capire in che modo la tua app utilizza lo spazio di archiviazione.

Android 15 aggiunge l'API StorageStats.getAppBytesByDataType([type]), che consente di ottenere informazioni su come la tua app utilizza tutto questo spazio, inclusi i raggruppamenti dei file APK, il codice AOT e relativo all'accelerazione, i metadati dex, le librerie e i profili guidati.

Profilazione gestita dall'app

Android 15 includes the ProfilingManager class, which lets you collect profiling information from within your app such as heap dumps, heap profiles, stack sampling, and more. It provides a callback to your app with a supplied tag to identify the output file, which is delivered to your app's files directory. The API does rate limiting to minimize the performance impact.

To simplify constructing profiling requests in your app, we recommend using the corresponding Profiling AndroidX API, available in Core 1.15.0-rc01 or higher.

Miglioramenti del database SQLite

Android 15 introduce le API SQLite che espongono funzionalità avanzate motore SQLite sottostante che ha come target specifici problemi di prestazioni che possono manifest nelle app. Queste API sono incluse nell'aggiornamento di SQLite alla versione 3.44.3.

Gli sviluppatori devono consultare le best practice per le prestazioni di SQLite per ottenere il massimo dal proprio database SQLite, in particolare quando si lavora con database di grandi dimensioni o quando si eseguono query sensibili alla latenza.

  • Transazioni differite di sola lettura: quando emetti transazioni di sola lettura (non includono istruzioni di scrittura), utilizza beginTransactionReadOnly() e beginTransactionWithListenerReadOnly(SQLiteTransactionListener) per emettere transazioni DEFERRED di sola lettura. Queste transazioni possono essere eseguite in contemporanea e, se il database è in modalità WAL, eseguita in concomitanza con IMMEDIATE o EXCLUSIVE transazioni.
  • Conteggi e ID righe: sono state aggiunte API per recuperare il conteggio righe o l'ultimo ID riga inserito senza inviare un'ulteriore query. getLastChangedRowCount() restituisce il numero di righe che sono stati inseriti, aggiornati o eliminati dall'istruzione SQL più recente all'interno la transazione corrente e getTotalChangedRowCount() restituisce il conteggio della connessione corrente. getLastInsertRowId() restituisce rowid dell'ultima riga da inserire nella connessione corrente.
  • Istruzioni non elaborate: invia un'istruzione SQlite non elaborata, aggirando la convenienza e l'eventuale overhead di elaborazione aggiuntivo che potrebbe subire.

Aggiornamenti di Android Dynamic Performance Framework

Android 15 continues our investment in the Android Dynamic Performance Framework (ADPF), a set of APIs that allow games and performance intensive apps to interact more directly with power and thermal systems of Android devices. On supported devices, Android 15 adds ADPF capabilities:

  • A power-efficiency mode for hint sessions to indicate that their associated threads should prefer power saving over performance, great for long-running background workloads.
  • GPU and CPU work durations can both be reported in hint sessions, allowing the system to adjust CPU and GPU frequencies together to best meet workload demands.
  • Thermal headroom thresholds to interpret possible thermal throttling status based on headroom prediction.

To learn more about how to use ADPF in your apps and games, head over to the documentation.

Privacy

Android 15 include una serie di funzionalità che aiutano gli sviluppatori di app a proteggere la privacy degli utenti.

Rilevamento della registrazione dello schermo

Android 15 adds support for apps to detect that they are being recorded. A callback is invoked whenever the app transitions between being visible or invisible within a screen recording. An app is considered visible if activities owned by the registering process's UID are being recorded. This way, if your app is performing a sensitive operation, you can inform the user that they're being recorded.

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 ampliate

Android 15 builds in support for more precise Intent resolution through UriRelativeFilterGroup, which contains a set of UriRelativeFilter objects that form a set of Intent matching rules that must each be satisfied, including URL query parameters, URL fragments, and blocking or exclusion rules.

These rules can be defined in the AndroidManifest XML file with the <uri-relative-filter-group> tag, which can optionally include an android:allow tag. These tags can contain <data> tags that use existing data tag attributes as well as the android:query and android:fragment attributes.

Here's an example of the AndroidManifest syntax:

<intent-filter android:autoVerify="true">
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.BROWSABLE" />
  <category android:name="android.intent.category.DEFAULT" />
  <data android:scheme="http" />
  <data android:scheme="https" />
  <data android:host="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

The private space can be unlocked and locked to show or hide sensitive apps on a device.

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:

Eseguire query sulla selezione utente più recente per l'accesso alle foto selezionate

Apps can now 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 di Android Ad Services, che incorporano la versione più recente di Privacy Sandbox su Android. Questa aggiunta fa parte del nostro impegno per sviluppare tecnologie che migliorino la privacy degli utenti e consentano esperienze pubblicitarie efficaci e personalizzate per le app mobile. Nella nostra pagina di Privacy Sandbox puoi trovare ulteriori informazioni su Privacy Sandbox su Android, sull'Anteprima per gli sviluppatori e sui programmi beta per iniziare.

Health Connect

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 additional 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:

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 della schermata dell'app

Android 15 supports app 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 app screen sharing experience. Note that for apps targeting Android 14 (API level 34) or higher, user consent is required for each MediaProjection capture session.

Esperienza utente e UI di sistema

Android 15 offre agli sviluppatori di app e agli utenti maggiore controllo e flessibilità per configurare il dispositivo in base alle loro esigenze.

Per saperne di più su come utilizzare i più recenti miglioramenti di Android 15 per migliorare l'esperienza utente della tua app, guarda il talk Migliorare l'esperienza utente della tua app Android di Google I/O.

Anteprime dei widget più ricche con l'API Anteprime generate

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.

Apps can provide Remote Views to the Widget Picker, so they can update the content in the picker to be more representative of what the user will see.

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:

  1. At any time, the widget provider calls setWidgetPreview. The provided previews are persisted in AppWidgetService with other provider info.
  2. setWidgetPreview notifies hosts of an updated preview through the AppWidgetHost.onProvidersChanged callback. In response, the widget host reloads all of its provider information.
  3. When displaying a widget preview, the host checks AppWidgetProviderInfo.generatedPreviewCategories, and if the chosen category is available, calls AppWidgetManager.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 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 another state.

With this UI state, apps targeting Android 15 (API level 35) 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 la funzionalità Attenzione Gestione delle regole (Non disturbare) e decidere quando attivarle o disattivarle che li rappresentano. Android 15 migliora notevolmente queste regole con l'obiettivo di migliorare un'esperienza utente positiva. Sono inclusi i seguenti miglioramenti:

  • Aggiunta di tipi a AutomaticZenRule, in modo che il sistema possa applicare tipi per alcune regole.
  • L'aggiunta di un'icona a AutomaticZenRule, che contribuisce a rendere le modalità più riconoscibili.
  • Aggiunta a AutomaticZenRule di una stringa triggerDescription che descriva le condizioni in cui la regola deve diventare attiva per l'utente.
  • Aggiunta ZenDeviceEffects a AutomaticZenRule, consentendo alle regole di attivare elementi come scala di grigi schermo, modalità notturna o attenuazione dello sfondo.

Impostare VibrationEffect per i canali di notifica

Android 15 supporta l'impostazione di vibrazioni intense per le notifiche in arrivo tramite canale utilizzando NotificationChannel.setVibrationEffect, i tuoi utenti possano distinguere tra diversi tipi di notifiche senza dover guardare il proprio dispositivo.

Chip della barra di stato per la proiezione multimediale e arresto automatico

Media projection can expose private user information. A new, prominent status bar chip makes users aware of any ongoing screen projection. Users can tap the chip to stop screen casting, sharing, or recording. Also, for a more intuitive user experience, any in‑progress screen projection now automatically stops when the device screen is locked.

Chip barra delle app per condivisione schermo, trasmissione e registrazione.

Schermi grandi e fattori di forma

Android 15 offre alle tue app il supporto per sfruttare al meglio i fattori di forma di Android, inclusi schermi grandi, dispositivi pieghevoli e flippable.

Multitasking migliorato su schermo grande

Android 15 offre agli utenti modi migliori per svolgere più attività contemporaneamente su dispositivi con schermi grandi. Ad esempio, gli utenti possono salvare le combinazioni di app con schermo diviso preferite per accedervi rapidamente e fissare la barra delle app sullo schermo per passare rapidamente da un'app all'altra. Ciò significa rendere l'app adattiva più importante che mai.

Google I/O offre sessioni su Creazione di app Android adattabili e Creazione di UI con la libreria adattabile Material 3 che possono essere utili. La nostra documentazione contiene ulteriori informazioni per aiutarti a creare design per schermi di grandi dimensioni.

Supporto dello schermo esterno

Your app can declare a property that Android 15 uses to allow your Application or Activity to be presented on the small cover screens of supported flippable devices. These screens are too small to be considered as compatible targets for Android apps to run on, but your app can opt in to supporting them, making your app available in more places.

Connettività

Android 15 aggiorna la piattaforma per consentire alla tua app di accedere ai più recenti progressi nelle tecnologie di comunicazione e wireless.

Supporto satellitare

Android 15 continua a estendere il supporto delle piattaforme per la connettività satellitare e include alcuni elementi dell'interfaccia utente per garantire un'esperienza utente coerente panorama della connettività satellitare.

Le app possono utilizzare ServiceState.isUsingNonTerrestrialNetwork() per rilevare quando un dispositivo è connesso a un satellite, in modo da avere una maggiore consapevolezza del motivo per cui i servizi di rete completi potrebbero non essere disponibili. Inoltre, Android 15 supporta le app SMS e MMS, nonché le app RCS precaricate, per utilizzare la connettività satellitare per l'invio e la ricezione di messaggi.

Quando il dispositivo si connette a un satellite, viene visualizzata una notifica.

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 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 introduces a Wallet role that allows tighter integration with the user's preferred wallet app. This role replaces the NFC default contactless payment setting. Users can manage the Wallet role holder by navigating to Settings > Apps > Default Apps.

The Wallet role is used when routing NFC taps for AIDs registered in the payment category. Taps always go to the Wallet role holder unless another app that is registered for the same AID is running in the foreground.

This role is also used to determine where the Wallet Quick Access tile should go when activated. When the role is set to "None", the Quick Access tile isn't available and payment category NFC taps are only delivered to the foreground app.

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. Guarda il talk Proteggere la sicurezza degli utenti su Android di Google I/O per scoprire di più su cosa stiamo facendo per migliorare le misure di sicurezza degli utenti e proteggere la tua app dalle nuove minacce.

Integrare Gestore delle credenziali con la compilazione automatica

A partire da Android 15, gli sviluppatori possono collegare viste specifiche, come i campi nome utente o password, alle richieste di Gestore delle credenziali, semplificando la fornitura di un'esperienza utente personalizzata durante la procedura di accesso. Quando l'utente si concentra su una di queste visualizzazioni, viene inviata una richiesta corrispondente a Credential Manager. Le credenziali risultanti vengono aggregate tra i fornitori e visualizzate nelle UI di riserva per la compilazione automatica, come i suggerimenti in linea o i suggerimenti del menu a discesa. La libreria Jetpack androidx.credentials è l'endpoint preferito per gli sviluppatori e sarà presto disponibile per migliorare ulteriormente questa funzionalità in Android 15 e versioni successive.

Integrare la registrazione e l'accesso con un solo tocco con i prompt biometrici

Gestore delle credenziali integra i prompt biometrici nella creazione delle credenziali e i processi di accesso, eliminando così la necessità da parte dei provider di gestire di prompt biometrici. Di conseguenza, i fornitori di credenziali devono concentrarsi solo i risultati dei flussi create e get, aumentati con il risultato del flusso biometrico. Questo processo semplificato crea credenziali più efficienti e semplificate processo di creazione e recupero.

Gestione delle chiavi per la crittografia end-to-end

Stiamo introducendo E2eeContactKeysManager in Android 15, che facilita la crittografia end-to-end (E2EE) nelle tue app per Android fornendo un'API a livello di sistema operativo per lo stoccaggio delle chiavi pubbliche di crittografia.

E2eeContactKeysManager è progettato per integrarsi con l'app 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 introduce un insieme di API che eseguono controlli delle autorizzazioni sugli URI dei contenuti:

Accessibilità

Android 15 aggiunge funzionalità che migliorano l'accessibilità per gli utenti.

Braille migliore

In Android 15, abbiamo reso possibile per TalkBack supportare i display braille che utilizzano lo standard HID sia tramite USB che tramite Bluetooth sicuro.

Questo standard, molto simile a quello utilizzato da mouse e tastiere, aiuterà Android a supportare nel tempo una gamma più ampia di display braille.

Internazionalizzazione

Android 15 aggiunge funzionalità e capacità 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 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.

How the variable font for Chinese, Japanese, and Korean (CJK) languages appears with different font widths.

Giustificazione tra i caratteri

Starting with Android 15, text can be justified utilizing letter spacing by using JUSTIFICATION_MODE_INTER_CHARACTER. Inter-word justification was first introduced in Android 8.0 (API level 26), and inter-character justification provides similar capabilities for languages that use the whitespace character for segmentation, such as Chinese, Japanese, and others.

Layout for Japanese text using JUSTIFICATION_MODE_NONE.
Layout for English text using JUSTIFICATION_MODE_NONE.


Layout for Japanese text using JUSTIFICATION_MODE_INTER_WORD.
Layout for English text using JUSTIFICATION_MODE_INTER_WORD.


Layout for Japanese text using the JUSTIFICATION_MODE_INTER_CHARACTER.
Layout for English text using the JUSTIFICATION_MODE_INTER_CHARACTER.

Configurazione automatica dell'interruzione di riga

Android ha iniziato a supportare le interruzioni di riga basate su frase per il giapponese e il coreano in Android 13 (livello API 33). Tuttavia, mentre le interruzioni di riga basate su frase migliorano leggibilità di brevi righe di testo, non sono ideali per righe di testo lunghe. In Android 15, le app possono applicare interruzioni di riga basate su frase solo per le righe brevi di testo, utilizzando la classe LINE_BREAK_WORD_STYLE_AUTO . Questa opzione seleziona lo stile della parola migliore per il testo.

Per brevi righe di testo, vengono utilizzate le interruzioni di riga basate su frase, che funzionano nello stesso modo come LINE_BREAK_WORD_STYLE_PHRASE, come mostrato in immagine seguente:

Per righe di testo brevi, LINE_BREAK_WORD_STYLE_AUTO applica interruzioni di riga basate su frase per migliorare la leggibilità del testo. È come applicare LINE_BREAK_WORD_STYLE_PHRASE.

Per le righe di testo più lunghe, LINE_BREAK_WORD_STYLE_AUTO utilizza uno stile di parola senza interruzione di riga, che funziona come LINE_BREAK_WORD_STYLE_NONE, come mostrato nell'immagine seguente:

Per lunghe righe di testo, LINE_BREAK_WORD_STYLE_AUTO non applica alcun tipo di interruzione di riga per migliorare la leggibilità del testo. Equivale ad applicare LINE_BREAK_WORD_STYLE_NONE.

Carattere Hentaigana giapponese aggiuntivo

In Android 15, a font file for old Japanese Hiragana (known as Hentaigana) is bundled by default. The unique shapes of Hentaigana characters can add a distinctive flair to artwork or design while also helping to preserve accurate transmission and understanding of ancient Japanese documents.

Character and text style for the Japanese Hentaigana font.

VideoLAN cone Copyright (c) 1996-2010 VideoLAN. This logo or a modified version may be used or modified by anyone to refer to the VideoLAN project or any product developed by the VideoLAN team, but does not indicate endorsement by the project.

Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.

OpenGL is a registered trademark and the OpenGL ES logo is a trademark of Hewlett Packard Enterprise used by permission by Khronos.