Android 15 incluye excelentes funciones y APIs para desarrolladores. En las siguientes secciones, se resumen estas funciones para ayudarte a comenzar a usar las APIs relacionadas.
Para obtener una lista detallada de las APIs nuevas, modificadas y quitadas, lee el informe de diferencias de APIs. Para obtener detalles sobre las nuevas APIs, consulta la referencia de la API de Android. Las nuevas APIs están destacadas para mayor visibilidad. Además, para conocer las áreas en las que los cambios de la plataforma podrían afectar a tus apps, asegúrate de revisar los cambios de comportamiento que afectan a las apps cuando se orientan a Android 15 y los cambios de comportamiento que afectan a todas las apps, independientemente detargetSdkVersion
.
Cámara y contenido multimedia
Android 15 incluye una variedad de funciones que mejoran la experiencia de la cámara y el contenido multimedia, y que te brindan acceso a herramientas y hardware para ayudar a los creadores a dar vida a su visión en Android.
Controles de cámara integrados en la app
En Android 15, se agrega una extensión nueva para tener más control sobre el hardware de la cámara y sus algoritmos en los dispositivos compatibles:
- Ajustes avanzados de intensidad del flash que permiten un control preciso de la intensidad del flash en los modos
SINGLE
yTORCH
mientras se capturan imágenes
Control del margen 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.
Control de volumen
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 soon be updated to leverage
LoudnessCodecController
APIs for a seamless app integration.
Mejora con poca luz
Android 15 presenta el Intensificador de poca luz, un nuevo modo de exposición automática disponible para la Cámara 2 y la extensión de la cámara en modo nocturno. La mejora con poca luz ajusta la exposición de la transmisión de la vista previa en condiciones de poca luz. Esto se diferencia de la manera en que la extensión de la cámara del modo nocturno crea imágenes estáticas, ya que el modo nocturno combina una ráfaga de fotos para crear una imagen única mejorada. Si bien el modo nocturno funciona muy bien para crear imágenes estáticas, no puede crear un flujo continuo de fotogramas, pero la potencia baja sí puede hacerlo. Por lo tanto, la potenciación con poca luz habilita funciones nuevas de la cámara, como las siguientes:
- Proporcionar una vista previa de imagen mejorada, de modo que los usuarios puedan enmarcar mejor sus fotos con poca luz
- Escaneo de códigos QR con poca luz
Si habilitas la amplificación de poca luz, se activará automáticamente cuando haya un nivel de luz tenue y se desactivará cuando haya más luz.
Las apps pueden grabar fuera de la transmisión de la versión preliminar en condiciones de poca luz para guardar un video iluminado.
Para obtener más información, consulta Potenciación del modo noche.
Dispositivos MIDI 2.0 virtuales
Android 13 agregó compatibilidad para conectarse a dispositivos MIDI 2.0 mediante USB, que se comunican mediante paquetes MIDI universales (UMP). Android 15 extiende la compatibilidad con UMP a apps MIDI virtuales, lo que permite que las apps de composición controlen las apps de sintetizador como un dispositivo MIDI 2.0 virtual, al igual que lo harían con un dispositivo MIDI USB 2.0.
Conectividad
Android 15 actualiza la plataforma para brindarle a tu app acceso a los avances más recientes en comunicación.
Compatibilidad por satélite
Android 15 continúa ampliando la compatibilidad de plataforma para la conectividad satelital e incluye algunos elementos de la IU para garantizar una experiencia del usuario coherente en todo el panorama de conectividad satelital.
Las apps pueden usar ServiceState.isUsingNonTerrestrialNetwork()
para detectar cuándo un dispositivo está conectado a un satélite, lo que les permite conocer mejor el motivo por el que los servicios de red completa podrían no estar disponibles. Además, Android 15 admite apps de SMS y MMS, así como apps de RCS precargadas para usar la conectividad satelital para enviar y recibir mensajes.
Experiencias NFC más fluidas
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.
Rol de billetera
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.
Productividad y herramientas para desarrolladores
Si bien la mayor parte de nuestro trabajo para mejorar tus centros de productividad se centra en herramientas como Android Studio, Jetpack Compose y las bibliotecas de Android Jetpack, siempre buscamos formas en la plataforma que te ayuden a concretar tu visión con mayor facilidad.
Mejoras de PDF
Android 15 Developer Preview 2 includes an early preview of 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 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.
Mejoras en el cambio automático 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 detallados de salto de línea
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:
Actualizaciones de 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.
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Pantallas y factores de forma grandes
Android 15 brinda a tus apps la compatibilidad para aprovechar al máximo los factores de forma de Android, incluidas las pantallas grandes, los dispositivos plegables y los dispositivos plegables.
Compatibilidad con la pantalla de portada
Tu app puede declarar una propiedad que Android 15 usa para permitir que tu Application
o Activity
se presente en las pequeñas pantallas de portada de los dispositivos que admiten la pantalla abatible. Estas pantallas son demasiado pequeñas para considerarlas como objetivos compatibles de modo que las apps para Android se ejecuten en ellas, pero tu app puede aceptar admitirlas, lo que hará que esté disponible en más lugares.
Rendimiento y batería
Android continúa su enfoque en ayudarte a mejorar el rendimiento y la calidad de tus apps. Android 15 introduce APIs nuevas que ayudan a que las tareas de tu app sean más eficientes de ejecutar, optimizar el rendimiento de las apps y recopilar estadísticas sobre tus apps.
API de 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.
Información detallada sobre el tamaño de la 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.
Mejoras en la base de datos SQLite
Android 15 introduces new SQLite APIs that expose advanced features from the underlying SQLite engine that target specific performance issues that can manifest in apps.
Developers should consult best practices for SQLite performance to get the most out of their SQLite database, especially when working with large databases or when running latency-sensitive queries.
- Read-only deferred transactions: when issuing transactions that are
read-only (don't include write statements), use
beginTransactionReadOnly()
andbeginTransactionWithListenerReadOnly(SQLiteTransactionListener)
to issue read-onlyDEFERRED
transactions. Such transactions can run concurrently with each other, and if the database is in WAL mode, they can run concurrently withIMMEDIATE
orEXCLUSIVE
transactions. - Row counts and IDs: new APIs were added to retrieve the count of changed
rows or the last inserted row ID without issuing an additional query.
getLastChangedRowCount()
returns the number of rows that were inserted, updated, or deleted by the most recent SQL statement within the current transaction, whilegetTotalChangedRowCount()
returns the count on the current connection.getLastInsertRowId()
returns therowid
of the last row to be inserted on the current connection. - Raw statements: issue a raw SQlite statement, bypassing convenience wrappers and any additional processing overhead that they may incur.
Actualizaciones del framework de rendimiento dinámico de Android
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 will add new 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.
Privacidad
Android 15 incluye una variedad de funciones que ayudan a los desarrolladores de apps a proteger la privacidad del usuario.
Detección de grabación de pantalla
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)
}
Capacidades expandidas de IntentFilter
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 new
<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 new android:query
and android:fragment
attributes.
Here's an example of the AndroidManifest
syntax:
<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>
Privacy Sandbox en Android
Android 15 lleva los Servicios de anuncios de Android hasta el nivel de extensión 10, lo que incorpora la versión más reciente de Privacy Sandbox en Android, parte de nuestro trabajo para desarrollar nuevas tecnologías que mejoren la privacidad del usuario y permitan experiencias de publicidad personalizadas y eficaces en apps para dispositivos móviles. En nuestra página de Privacy Sandbox, encontrarás más información sobre Privacy Sandbox en la Vista previa para desarrolladores de Android y programas de versiones beta que te ayudarán a comenzar.
Health Connect
Android 15 integra las extensiones 10 de Android 14 en torno a Health Connect de Android, una plataforma segura y centralizada para administrar y compartir los datos de salud y fitness recopilados por la app. Esta actualización agrega compatibilidad con nuevos tipos de datos de actividad física, nutrición y mucho más.
Compartir pantalla parcialmente
Android 15 admite el uso compartido parcial de la pantalla, de modo que los usuarios puedan compartir o grabar solo una ventana de la app en lugar de toda la pantalla del dispositivo. Esta función, habilitada por primera vez en QPR2 para Android 14, incluye devoluciones de llamada de MediaProjection
que permiten que tu app personalice la experiencia de compartir pantalla de forma parcial. Ten en cuenta que, en el caso de las apps orientadas a Android 14 (nivel de API 34) o versiones posteriores, ahora se requiere el consentimiento del usuario para cada sesión de captura de MediaProjection
.
Seguridad
Android 15 te ayuda a mejorar la seguridad de tu app y a proteger sus datos.
Protege archivos con fs-verity
El FileIntegrityManager
de Android 15 incluye APIs nuevas que aprovechan la potencia de la función fs-verity en el kernel de Linux. Con fs-verity, los archivos se pueden proteger con firmas criptográficas personalizadas, lo que te ayuda a asegurarte de que no se hayan alterado ni dañado. Esto mejora la seguridad, lo que te brinda protección contra posible software malicioso o modificaciones no autorizadas de archivos que podrían comprometer la funcionalidad o los datos de tu app.
Experiencia del usuario
Android 15 les brinda a los desarrolladores de apps y a los usuarios más control y flexibilidad para configurar sus dispositivos de modo que se ajusten a sus necesidades.
Reglas para la función No interrumpir mejoradas
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 toAutomaticZenRule
that describes the conditions on which the rule should become active for the user. - Added
ZenDeviceEffects
toAutomaticZenRule
, allowing rules to trigger things like grayscale display, night mode, or dimming the wallpaper.