Visão geral de recursos e APIs

O Android 15 introduz ótimos recursos e APIs novos para desenvolvedores. As seções a seguir resumim esses recursos para ajudar você a começar a usar as APIs relacionadas.

Para uma lista detalhada das APIs novas, modificadas e removidas, leia o Relatório de diferenças da API. Para ver detalhes sobre as novas APIs, acesse a Referência da API do Android. As novas APIs estão em destaque para melhor visibilidade. Além disso, para saber mais sobre as áreas em que as mudanças de plataforma podem afetar seus apps, analise as mudanças de comportamento que afetam os apps direcionados ao Android 15 e as mudanças de comportamento que afetam todos os apps, independente da targetSdkVersion.

Câmera e mídia

O Android 15 inclui uma variedade de recursos que melhoram a experiência da câmera e de mídia e que dão acesso a ferramentas e hardware para ajudar os criadores a dar vida às ideias deles no Android.

Aumento de pouca luz

Android 15 introduces Low Light Boost, a new auto-exposure mode available to both Camera 2 and the night mode camera extension. Low Light Boost adjusts the exposure of the Preview stream in low-light conditions. This is different from how the night mode camera extension creates still images, because night mode combines a burst of photos to create a single, enhanced image. While night mode works very well for creating a still image, it can't create a continuous stream of frames, but Low Light Boost can. Thus, Low Light Boost enables new camera capabilities, such as:

  • Providing an enhanced image preview, so users are better able to frame their low-light pictures
  • Scanning QR codes in low light

If you enable Low Light Boost, it automatically turns on when there's a low light level, and turns off when there's more light.

Apps can record off the Preview stream in low-light conditions to save a brightened video.

For more information, see Low Light Boost.

Controles da câmera no 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 and TORCH modes while capturing images.

Controle da margem de 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.

Controle de 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.

Dispositivos MIDI 2.0 virtual

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.

Conectividade

O Android 15 atualiza a plataforma para oferecer ao app acesso aos avanços mais recentes em comunicação.

Suporte a satélite

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.

A notification appears when the device connects to a satellite.

Experiências de NFC mais fáceis

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 fingerprint on supported devices so they can be notified of polling loop activity, which allows for smooth operation with multiple NFC-aware applications.

Papel da Carteira

Android 15 introduces a new 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 QuickAccess tile should go when activated. When the role is set to "None", the QuickAccess tile isn't available and payment category NFC taps are only delivered to the foreground app.

Produtividade e ferramentas para desenvolvedores

Embora a maior parte do nosso trabalho para melhorar a produtividade seja centrada em ferramentas como o Android Studio, o Jetpack Compose e as bibliotecas do Android Jetpack, sempre procuramos maneiras de ajudar você a concretizar suas ideias.

Melhorias nos PDFs

Android 15 includes substantial improvements to the PdfRenderer APIs. Apps can incorporate advanced features such as rendering password-protected files, annotations, form editing, searching, and selection with copy. Linearized PDF optimizations are supported to speed local PDF viewing and reduce resource use.

The latest updates to PDF rendering include features such as searching an embedded PDF file.

The PdfRenderer has been moved to a module that can be updated using Google Play system updates independent of the platform release, and we're supporting these changes back to Android 11 (API level 30) by creating a compatible pre-Android 15 version of the API surface, called PdfRendererPreV.

We value your feedback on the enhancements we've made to the PdfRenderer API surface, and we plan to make it even easier to incorporate these APIs into your app with an upcoming Android Jetpack library.

Refinamentos automáticos da troca de idioma

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.

Controles de quebra de linha granulares

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.

Atualizações do OpenJDK 17

O Android 15 continua o trabalho de atualizar as principais bibliotecas do Android para se alinhar aos recursos das versões mais recentes do LTS do OpenJDK.

Os seguintes recursos e melhorias principais estão incluídos:

Essas APIs são atualizadas em mais de um bilhão de dispositivos com o Android 12 (nível 31 da API) e versões mais recentes com as atualizações do sistema do Google Play. Assim, você pode usar os recursos de programação mais recentes.

Java e OpenJDK são marcas registradas da Oracle e/ou afiliadas.

Arquivamento de apps

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.

Acessibilidade

O Android 15 adiciona recursos que melhoram a acessibilidade para os usuários.

Melhor braille

No Android 15, agora é possível para o TalkBack oferecer suporte a telas em braille que usam o padrão HID por USB e Bluetooth seguro.

Esse padrão, muito parecido com o usado por mouses e teclados, vai ajudar o Android a oferecer suporte a uma maior variedade de telas em braille com o tempo.

Telas e formatos grandes

O Android 15 oferece aos apps suporte para aproveitar ao máximo os formatos do Android, incluindo telas grandes, dispositivos dobráveis e dobráveis.

Suporte para a tela de capa

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.

Performance e bateria

O Android continua focado em ajudar você a melhorar o desempenho e a qualidade dos seus apps. O Android 15 introduz novas APIs que ajudam a tornar a execução de tarefas mais eficiente no app, otimizar o desempenho dele e coletar insights sobre os apps.

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.

Informações detalhadas sobre o tamanho do 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.

Criação de perfis gerenciada pelo app

Android 15 includes the all-new ProfilingManager class, which lets you collect profiling information from within your app. We're planning to wrap this with an Android Jetpack API that will simplify construction of profiling requests, but the core API will allow the collection of 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.

Melhorias no banco de dados SQLite

O Android 15 apresenta novas APIs SQLite que expõem recursos avançados do mecanismo SQLite subjacente, voltados para problemas específicos de desempenho que podem se manifestar em apps.

Os desenvolvedores precisam consultar as práticas recomendadas para performance do SQLite (link em inglês) para aproveitar ao máximo o banco de dados SQLite, especialmente ao trabalhar com bancos de dados grandes ou executar consultas sensíveis à latência.

  • Transações adiadas somente leitura: ao emitir transações que são somente leitura (não inclua instruções de gravação), use beginTransactionReadOnly() e beginTransactionWithListenerReadOnly(SQLiteTransactionListener) para emitir transações DEFERRED somente leitura. Essas transações podem ser executadas simultaneamente entre si e, se o banco de dados estiver no modo WAL, elas poderão ser executadas simultaneamente com transações IMMEDIATE ou EXCLUSIVE.
  • Contagem e IDs de linhas: novas APIs foram adicionadas para recuperar a contagem de linhas alteradas ou o último ID da linha inserida sem emitir uma consulta extra. getLastChangedRowCount() retorna o número de linhas que foram inseridas, atualizadas ou excluídas pela instrução SQL mais recente na transação atual, enquanto getTotalChangedRowCount() retorna a contagem na conexão atual. getLastInsertRowId() retorna a rowid da última linha a ser inserida na conexão atual.
  • Instruções brutas: emita uma instrução SQlite bruta, ignorando wrappers de conveniência e qualquer sobrecarga adicional de processamento que possa incorrer.

Atualizações do framework de desempenho dinâmico do Android

O Android 15 continua nosso investimento no Android Dynamic Performance Framework (ADPF), um conjunto de APIs que permite que jogos e apps com alto desempenho interajam mais diretamente com os sistemas térmicos e de energia de dispositivos Android. Em dispositivos com suporte, o Android 15 vai adicionar novos recursos de ADPF:

  • Um modo de eficiência energética para sessões de dicas indicam que as linhas de execução associadas preferem a economia de energia em vez do desempenho, o que é ótimo para cargas de trabalho em segundo plano de longa duração.
  • As durações do trabalho de GPU e da CPU podem ser informadas em sessões de dicas, permitindo que o sistema ajuste as frequências de CPU e GPU juntas para atender melhor às demandas de carga de trabalho.
  • Limites da margem térmica para interpretar o possível status de limitação térmica com base na previsão da margem.

Para saber mais sobre como usar o ADPF em apps e jogos, acesse a documentação.

Privacidade

O Android 15 inclui uma variedade de recursos que ajudam os desenvolvedores de apps a proteger a privacidade do usuário.

Detecção de gravação de tela

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)
}

Ampliação dos recursos do IntentFilter

Os builds do Android 15 oferecem suporte a uma resolução de Intent mais precisa usando UriRelativeFilterGroup, que contém um conjunto de objetos UriRelativeFilter que formam um conjunto de regras de correspondência de Intent que precisam ser atendidas, incluindo parâmetros de consulta de URL, fragmentos de URL e regras de bloqueio ou exclusão.

Essas regras podem ser definidas no arquivo XML AndroidManifest com a nova tag <uri-relative-filter-group>, que pode incluir uma tag android:allow. Essas tags podem conter <data> que usam atributos de tag de dados existentes, bem como os novos atributos android:query e android:fragment.

Confira um exemplo de sintaxe 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>

Sandbox de privacidade no Android

Android 15 includes the latest Android Ad Services extensions, incorporating the latest version of the Privacy Sandbox on Android. This addition is part of our work to develop new technologies that improve user privacy and enable effective, personalized advertising experiences for mobile apps. Our privacy sandbox page has more information about the Privacy Sandbox on Android developer preview and beta programs to help you get started.

Conexão Saúde

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:

Learn more about the latest updates to Health Connect in Android in the Building adaptable experiences with Android Health talk from Google I/O.

Compartilhamento de tela parcial

O Android 15 oferece suporte ao compartilhamento de tela parcial para que os usuários possam compartilhar ou gravar apenas uma janela do app em vez da tela inteira do dispositivo. Esse recurso, ativado pela primeira vez no QPR2 do Android 14, inclui callbacks MediaProjection que permitem que o app personalize a experiência de compartilhamento de tela parcial. Para apps destinados ao Android 14 (nível 34 da API) ou versões mais recentes, o consentimento do usuário agora é necessário para cada sessão de captura da MediaProjection.

Segurança

O Android 15 ajuda a melhorar a segurança e proteger os dados do app.

Gerenciamento de chaves para criptografia de ponta a ponta

We are introducing the E2eeContactKeysManager in Android 15, which facilitates end-to-end encryption (E2EE) in your Android apps by providing an OS-level API for the storage of cryptographic public keys.

The E2eeContactKeysManager is designed to integrate with the platform contacts app to give users a centralized way to manage and verify their contacts' public keys.

Proteger arquivos com o fs-verity

Experiência do usuário

O Android 15 oferece aos desenvolvedores de apps e usuários mais controle e flexibilidade para configurar os dispositivos de acordo com as necessidades deles.

Regras do "Não perturbe" aprimoradas

AutomaticZenRule lets apps customize Attention Management (Do Not Disturb) rules and decide when to activate or deactivate them. Android 15 greatly enhances these rules with the goal of improving the user experience. The following enhancements are included:

  • Adding types to AutomaticZenRule, allowing the system to apply special treatment to some rules.
  • Adding an icon to AutomaticZenRule, helping to make the modes be more recognizable.
  • Adding a triggerDescription string to AutomaticZenRule that describes the conditions on which the rule should become active for the user.
  • Added ZenDeviceEffects to AutomaticZenRule, allowing rules to trigger things like grayscale display, night mode, or dimming the wallpaper.

Internacionalização

O Android 15 adiciona recursos e funcionalidades que complementam a experiência do usuário quando um dispositivo é usado em idiomas diferentes.

Justificativa entre caracteres

No Android 15 e versões mais recentes, o texto pode ser justificado utilizando o espaçamento entre letras com JUSTIFICATION_MODE_INTER_CHARACTER. A justificativa entre palavras foi introduzida pela primeira vez no Android 8.0 (nível 26 da API), e a justificativa entre caracteres oferece recursos semelhantes para idiomas que usam o caractere de espaço em branco para segmentação, como chinês, japonês e outros.

Layout para texto em japonês usando JUSTIFICATION_MODE_NONE.
Layout para texto em inglês usando JUSTIFICATION_MODE_NONE.


Layout para texto em japonês usando JUSTIFICATION_MODE_INTER_WORD.
Layout para texto em inglês usando JUSTIFICATION_MODE_INTER_WORD.


Layout para texto em japonês usando o novo JUSTIFICATION_MODE_INTER_CHARACTER.
Layout para texto em inglês usando o novo JUSTIFICATION_MODE_INTER_CHARACTER.