O Android 14 introduz ótimos recursos e APIs para desenvolvedores. As informações a seguir ajudam você a conhecer os recursos disponíveis para os apps e a começar a usar as APIs relacionadas.
Para uma lista detalhada de APIs adicionadas, modificadas e removidas, leia a diferença de API . Para saber mais sobre as APIs adicionadas, acesse a Referência da API do Android. No Android 14, procure as APIs que foram adicionadas no nível 34 da API. Para saber mais sobre as áreas em que as mudanças na plataforma podem afetar seus apps, confira as mudanças de comportamento do Android 14 para apps destinados ao Android 14 e para todos os apps.
Internacionalização
Seleção de idioma por app
Android 14 expands on the per-app language features that were introduced in Android 13 (API level 33) with these additional capabilities:
Automatically generate an app's
localeConfig
: Starting with Android Studio Giraffe Canary 7 and AGP 8.1.0-alpha07, you can configure your app to support per-app language preferences automatically. Based on your project resources, the Android Gradle plugin generates theLocaleConfig
file and adds a reference to it in the final manifest file, so you no longer have to create or update the file manually. AGP uses the resources in theres
folders of your app modules and any library module dependencies to determine the locales to include in theLocaleConfig
file.Dynamic updates for an app's
localeConfig
: Use thesetOverrideLocaleConfig()
andgetOverrideLocaleConfig()
methods inLocaleManager
to dynamically update your app's list of supported languages in the device's system settings. Use this flexibility to customize the list of supported languages per region, run A/B experiments, or provide an updated list of locales if your app utilizes server-side pushes for localization.App language visibility for input method editors (IMEs): IMEs can utilize the
getApplicationLocales()
method to check the language of the current app and match the IME language to that language.
API Grammatical Inflection
3 billion people speak gendered languages: languages where grammatical categories—such as nouns, verbs, adjectives, and prepositions—inflect according to the gender of people and objects you talk to or about. Traditionally, many gendered languages use masculine grammatical gender as the default or generic gender.
Addressing users in the wrong grammatical gender, such as addressing women in masculine grammatical gender, can negatively impact their performance and attitude. In contrast, a UI with language that correctly reflects the user's grammatical gender can improve user engagement and provide a more personalized and natural-sounding user experience.
Para ajudar a criar uma interface focada no usuário para idiomas com flexão de gênero, o Android 14 apresenta a API Grammatical Inflection, que permite adicionar suporte aos gêneros gramaticais sem refatorar o app.
Preferências regionais
Regional preferences enable users to personalize temperature units, the first day of the week, and numbering systems. A European living in the United States might prefer temperature units to be in Celsius rather than Fahrenheit and for apps to treat Monday as the beginning of the week instead of the US default of Sunday.
New Android Settings menus for these preferences provide users with a
discoverable and centralized location to change app preferences. These
preferences also persist through backup and restore. Several APIs and
intents—such as
getTemperatureUnit
and
getFirstDayOfWeek
—
grant your app read access to user preferences, so your app can adjust how it
displays information. You can also register a
BroadcastReceiver
on
ACTION_LOCALE_CHANGED
to handle locale configuration changes when regional preferences change.
To find these settings, open the Settings app and navigate to System > Languages & input > Regional preferences.


Acessibilidade
Dimensionamento de fonte não linear para 200%
No Android 14 e versões mais recentes, o sistema oferece suporte ao escalonamento de fontes até 200%, oferecendo aos usuários com baixa visão outras opções de acessibilidade alinhadas às Diretrizes de Acessibilidade para Conteúdo Web (WCAG, na sigla em inglês).
Para evitar que elementos de texto grandes na tela fiquem grandes demais, o sistema aplica uma curva de dimensionamento não linear. Essa estratégia significa que textos grandes não são dimensionados na mesma taxa que os menores. O dimensionamento de fonte não linear ajuda a preservar a hierarquia proporcional entre elementos de tamanhos diferentes, reduzindo problemas com o dimensionamento linear em graus elevados, como cortes de texto ou dificuldade de leitura devido a telas muito grandes.
Testar o app com dimensionamento de fontes não linear

Se você já usa unidades de pixels dimensionados (sp, na sigla em inglês) para definir o dimensionamento do texto, essas outras opções e melhorias de dimensionamento são aplicadas automaticamente ao texto do app. No entanto, ainda é necessário realizar testes de interface com o tamanho máximo da fonte ativado (200%) para garantir que o app aplique os tamanhos de fonte corretamente e possa acomodar fontes maiores sem afetar a usabilidade.
Para ativar o tamanho de fonte de 200%, siga estas etapas:
- Abra o app Configurações e navegue até Acessibilidade > Texto e tamanho de exibição.
- Na opção Tamanho da fonte, toque no ícone de adição (+) até ativar a configuração de tamanho máximo de fonte, conforme mostrado na imagem que acompanha esta seção.
Usar unidades de pixels dimensionados (sp) para tamanhos de texto
Sempre especifique tamanhos de texto em unidades de sp. Quando o app usa unidades de sp, o Android pode aplicar o tamanho de texto preferencial do usuário e escaloná-lo adequadamente.
Não use unidades de sp para preenchimento ou defina as alturas da visualização presumindo que o padding implícito: com o dimensionamento de fonte não linear, as dimensões de sp podem não ser proporcionais. Portanto, 4sp + 20sp podem não ser iguais a 24sp.
Converter unidades de pixels dimensionados
Use TypedValue.applyDimension()
para converter unidades de sp
em pixels, e TypedValue.deriveDimension()
para
converter pixels em sp. Esses métodos aplicam a curva de dimensionamento não linear adequada
automaticamente.
Evite equações fixadas no código usando
Configuration.fontScale
ou
DisplayMetrics.scaledDensity
. Como o dimensionamento da fonte não é
linear, o campo scaledDensity
não é mais preciso. O campo fontScale
precisa ser usado apenas para fins informativos porque as fontes não são mais
escalonadas com um único valor escalar.
Usar unidades sp para lineHeight
Sempre defina android:lineHeight
usando unidades sp em vez
de dp, para que a altura da linha seja dimensionada de acordo com o texto. Caso contrário, se o texto
for sp, mas a lineHeight
estiver em dp ou px, ele não será dimensionado e parecerá apertado.
A TextView corrige automaticamente a lineHeight
para que as proporções
pretendidas sejam preservadas, mas somente se textSize
e lineHeight
forem
definidos em unidades sp.
Câmera e mídia
Ultra HDR para imagens

Android 14 新增了对高动态范围 (HDR) 图片的支持,可在拍摄照片时保留更多来自传感器的信息,从而实现鲜艳的色彩和更高的对比度。Android 使用 Ultra HDR 格式,该格式与 JPEG 图片完全向后兼容,可让应用与 HDR 图片无缝互操作,并根据需要以标准动态范围 (SDR) 显示这些图片。
当您的应用选择为其 activity 窗口使用 HDR 界面(通过清单条目或通过在运行时调用 Window.setColorMode()
)时,框架会自动在界面中以 HDR 格式渲染这些图片。您还可以在受支持的设备上拍摄压缩的 Ultra HDR 静态图片。从传感器中恢复的颜色越多,后期编辑的灵活性就越高。与 Ultra HDR 图片关联的 Gainmap
可用于使用 OpenGL 或 Vulkan 渲染这些图片。
Zoom, foco, visualização pós-gravação e muito mais nas extensões da câmera
Android 14 upgrades and improves camera extensions, allowing apps to handle longer processing times, which enables improved images using compute-intensive algorithms like low-light photography on supported devices. These features give users an even more robust experience when using camera extension capabilities. Examples of these improvements include:
- Dynamic still capture processing latency estimation provides much more
accurate still capture latency estimates based on the current scene and
environment conditions. Call
CameraExtensionSession.getRealtimeStillCaptureLatency()
to get aStillCaptureLatency
object that has two latency estimation methods. ThegetCaptureLatency()
method returns the estimated latency betweenonCaptureStarted
andonCaptureProcessStarted()
, and thegetProcessingLatency()
method returns the estimated latency betweenonCaptureProcessStarted()
and the final processed frame being available. - Support for capture progress callbacks so that apps can display the current
progress of long-running, still-capture processing operations. You can check
if this feature is available with
CameraExtensionCharacteristics.isCaptureProcessProgressAvailable
, and if it is, you implement theonCaptureProcessProgressed()
callback, which has the progress (from 0 to 100) passed in as a parameter. Extension specific metadata, such as
CaptureRequest.EXTENSION_STRENGTH
for dialing in the amount of an extension effect, such as the amount of background blur withEXTENSION_BOKEH
.Postview Feature for Still Capture in camera extensions, which provides a less-processed image more quickly than the final image. If an extension has increased processing latency, a postview image could be provided as a placeholder to improve UX and switched out later for the final image. You can check if this feature is available with
CameraExtensionCharacteristics.isPostviewAvailable
. Then you can pass anOutputConfiguration
toExtensionSessionConfiguration.setPostviewOutputConfiguration
.Support for
SurfaceView
allowing for a more optimized and power-efficient preview render path.Support for tap to focus and zoom during extension usage.
Zoom no sensor
当 CameraCharacteristics
中的 REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE
包含 SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
时,您的应用可以使用高级传感器功能,将剪裁后的 RAW 数据流的像素与全视野范围相同,方法是将 CaptureRequest
与将数据流用例设置为 CameraMetadata.SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW
的 RAW 目标搭配使用。通过实现请求替换控件,更新后的相机可让用户在其他相机控件准备就绪之前使用缩放控件。
Áudio USB sem perdas
Android 14 gains support for lossless audio formats for audiophile-level
experiences over USB wired headsets. You can query a USB device for its
preferred mixer attributes, register a listener for changes in preferred mixer
attributes, and configure mixer attributes using the
AudioMixerAttributes
class. This class represents the
format, such as channel mask, sample rate, and behavior of the audio mixer. The
class allows for audio to be sent directly, without mixing,
volume adjustment, or processing effects.
Produtividade e ferramentas para desenvolvedores
Credential Manager
Android 14 将 Credential Manager 添加为平台 API,并通过使用 Google Play 服务的 Jetpack 库,向后额外支持 Android 4.4(API 级别 19)设备。Credential Manager 旨在通过 API 使用用户配置的凭据提供程序检索和存储凭据,让用户更轻松地登录。Credential Manager 在单个 API 中支持多种登录方法,包括用户名和密码、通行密钥和联合登录解决方案(如“使用 Google 账号登录”)。
通行密钥具有许多优势。例如,通行密钥是基于业界标准构建的,可在各种不同的操作系统和浏览器生态系统中使用,并且可用于网站和应用。
如需了解详情,请参阅 Credential Manager 和通行密钥文档以及介绍 Credential Manager 和通行密钥的博文。
Conexão Saúde
Health Connect is an on-device repository for user health and fitness data. It allows users to share data between their favorite apps, with a single place to control what data they want to share with these apps.
On devices running Android versions prior to Android 14, Health Connect is available to download as an app on the Google Play store. Starting with Android 14, Health Connect is part of the platform and receives updates through Google Play system updates without requiring a separate download. With this, Health Connect can be updated frequently, and your apps can rely on Health Connect being available on devices running Android 14 or higher. Users can access Health Connect from the Settings in their device, with privacy controls integrated into the system settings.


Health Connect includes several new features in Android 14, such as exercise routes, allowing users to share a route of their workout which can be visualized on a map. A route is defined as a list of locations saved within a window of time, and your app can insert routes into exercise sessions, tying them together. To ensure that users have complete control over this sensitive data, users must allow sharing individual routes with other apps.
For more information, see the Health Connection documentation and the blogpost on What's new in Android Health.
Atualizações do OpenJDK 17
Android 14 continues the work of refreshing Android's core libraries to align with the features in the latest OpenJDK LTS releases, including both library updates and Java 17 language support for app and platform developers.
The following features and improvements are included:
- Updated approximately 300
java.base
classes to Java 17 support. - Text Blocks, which introduce multi-line string literals to the Java programming language.
- Pattern Matching for instanceof, which allows an object to
be treated as having a specific type in an
instanceof
without any additional variables. - Sealed classes, which allow you restrict which classes and interfaces can extend or implement them.
Thanks to Google Play system updates (Project Mainline), over 600 million devices are enabled to receive the latest Android Runtime (ART) updates that include these changes. This is part of our commitment to give apps a more consistent, secure environment across devices, and to deliver new features and capabilities to users independent of platform releases.
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Melhorias para app stores
Android 14 引入了多个 PackageInstaller
API,可帮助应用商店改善其用户体验。
下载之前请求批准安装
安装或更新应用可能需要用户批准。例如,当使用 REQUEST_INSTALL_PACKAGES
权限的安装程序尝试安装新应用时。在之前的 Android 版本中,只有在将 APK 写入安装会话并且提交会话后,应用商店才能请求用户批准。
从 Android 14 开始,requestUserPreapproval()
方法可让安装程序在提交安装会话之前请求用户批准。此项改进可让应用商店将任何 APK 的下载操作推迟到用户批准安装之后。此外,用户批准安装后,应用商店可以在后台下载并安装应用,而不会干扰用户。
承担未来更新的责任
借助 setRequestUpdateOwnership()
方法,安装程序可以向系统表明它打算负责将被安装的应用未来的更新。此 capability 可实现更新所有权强制执行,即仅允许更新所有者为应用安装自动更新。更新所有权强制执行有助于确保用户仅收到来自预期应用商店的更新。
任何其他安装程序(包括使用 INSTALL_PACKAGES
权限的安装程序)都必须获得用户的明确批准,才能安装更新。如果用户决定继续从其他来源安装更新,则会失去更新所有权。
在干扰较少的时段更新应用
应用商店通常希望避免更新正在使用的应用,因为这会导致应用正在运行的进程被终止,而这可能会中断用户正在执行的操作。
从 Android 14 开始,InstallConstraints
API 让安装程序可以确保其应用更新在适当的时机进行。例如,应用商店可以调用 commitSessionAfterInstallConstraintsAreMet()
方法来确保仅在用户不再与相应应用互动时才进行更新。
无缝安装可选拆分
借助拆分 APK,应用的功能可以通过单独的 APK 文件提供,而不是以单体式 APK 的形式提供。借助拆分 APK,应用商店可以优化不同应用组件的提供。例如,应用商店可能会根据目标设备的属性进行优化。自在 API 级别 22 中引入以来,PackageInstaller
API 一直支持拆分。
在 Android 14 中,setDontKillApp()
方法可让安装程序指明在安装新的拆分项时应用的运行进程不应终止。应用商店可以使用此功能,在用户使用应用时无缝安装应用的新功能。
Pacotes de metadados do app
A partir do Android 14, o instalador do pacote do Android permite que você especifique os metadados do app, como práticas de segurança de dados, que serão incluídos em páginas de app stores, como o Google Play.
Detectar quando usuários fazem capturas de tela no dispositivo
To create a more standardized experience for detecting screenshots, Android 14 introduces a privacy-preserving screenshot detection API. This API lets apps register callbacks on a per-activity basis. These callbacks are invoked, and the user is notified, when the user takes a screenshot while that activity is visible.
Experiência do usuário
Ações personalizadas e melhoria na classificação do Sharesheet
Android 14 更新了系统 Sharesheet,以便为用户提供自定义应用操作和信息更丰富的预览结果。
添加自定义操作
对于 Android 14,您的应用可以向其调用的系统 Sharesheet 添加自定义操作。

提高直接共享目标的排名
Android 14 根据来自应用的更多信号来确定直接共享目标的排名,以便为用户提供更实用的结果。为了提供最实用的排名信号,请遵循提高直接共享目标排名的准则。通讯应用还可以报告出站和入站消息的快捷方式使用情况。

Suporte a animações de voltas preditivas integradas e personalizadas
Android 13 introduced the predictive back-to-home animation behind a developer option. When used in a supported app with the developer option enabled, swiping back shows an animation indicating that the back gesture exits the app back to the home screen.
Android 14 includes multiple improvements and new guidance for Predictive Back:
- You can set
android:enableOnBackInvokedCallback=true
to opt in to predictive back system animations per-Activity instead of for the entire app. - We've added new system animations to accompany the back-to-home animation from Android 13. The new system animations are cross-activity and cross-task, which you get automatically after migrating to Predictive Back.
- We've added new Material Component animations for Bottom sheets, Side sheets, and Search.
- We've created design guidance for creating custom in-app animations and transitions.
- We've added new APIs to support custom in-app transition animations:
handleOnBackStarted
,handleOnBackProgressed
,handleOnBackCancelled
in
OnBackPressedCallback
onBackStarted
,onBackProgressed
,onBackCancelled
in
OnBackAnimationCallback
- Use
overrideActivityTransition
instead ofoverridePendingTransition
for transitions that respond as the user swipes back.
With this Android 14 preview release, all features of Predictive Back remain behind a developer option. See the developer guide to migrate your app to predictive back, as well as the developer guide to creating custom in-app transitions.
Substituições por app do fabricante de dispositivos de tela grande
As substituições por app permitem que os fabricantes mudem o comportamento dos apps em dispositivos de tela grande. Por exemplo, a substituição FORCE_RESIZE_APP
instrui o sistema a redimensionar o app para que se ajuste às dimensões de exibição (evitando o modo de compatibilidade de tamanho), mesmo que resizeableActivity="false"
esteja definido no manifesto do app.
As substituições têm como objetivo melhorar a experiência do usuário em telas grandes.
As novas propriedades do manifesto permitem desativar algumas substituições do fabricante do dispositivo para o app.
Substituições por app para usuários de telas grandes
As substituições por app mudam o comportamento dos apps em dispositivos de tela grande. Por exemplo, a substituição do fabricante do dispositivo OVERRIDE_MIN_ASPECT_RATIO_LARGE
define a proporção do app como 16:9, independente da configuração dele.
O Android 14 QPR1 permite que os usuários apliquem substituições por app usando um novo menu de configurações em dispositivos de tela grande.
Compartilhamento de tela de app
App screen sharing enables users to share an app window instead of the entire device screen during screen content recording.
With app screen sharing, the status bar, navigation bar, notifications, and other system UI elements are excluded from the shared display. Only the content of the selected app is shared.
App screen sharing improves productivity and privacy by enabling users to run multiple apps but limit content sharing to a single app.
Resposta inteligente com LLM no Gboard no Pixel 8 Pro
在搭载 12 月功能分块的 Pixel 8 Pro 设备上,开发者可以在 Gboard 中试用质量更高的智能回复,这些回复由在 Google Tensor 上运行的设备端大语言模型 (LLM) 提供支持。
此功能目前仅在 WhatsApp、Line 和 KakaoTalk 中以美式英语的形式提供给用户进行小范围测试。此功能需要使用 Pixel 8 Pro 设备,并将 Gboard 用作键盘。
如需试用此功能,请先依次前往设置 > 开发者选项 > AiCore 设置 > 启用 Aicore 持久性,启用该功能。
接下来,在受支持的应用中打开对话,即可在 Gboard 的建议栏中看到依托 LLM 的智能回复,以便回复收到的消息。
Gráficos
Os caminhos podem ser consultados e interpolados
A API Path
do Android é um mecanismo avançado e flexível para
criar e renderizar gráficos vetoriais, com a capacidade de traçar ou preencher um
caminho, construir um caminho a partir de segmentos de linha ou curvas quadráticas ou cúbicas, realizar
operações booleanas para conseguir formas ainda mais complexas ou todas essas
formas simultaneamente. Uma limitação é a capacidade de descobrir o que está
presente em um objeto de caminho. Os componentes internos do objeto são opacos para autores de chamadas
após a criação.
Para criar um Path
, chame métodos como
moveTo()
, lineTo()
e
cubicTo()
para adicionar segmentos de caminho. Mas não há uma maneira de perguntar a esse caminho quais são os segmentos. Portanto, você precisa manter essas informações no momento da criação.
A partir do Android 14, é possível consultar caminhos para descobrir o que há dentro deles.
Primeiro, você precisa conseguir um objeto PathIterator
usando a API Path.getPathIterator
:
Kotlin
val path = Path().apply { moveTo(1.0f, 1.0f) lineTo(2.0f, 2.0f) close() } val pathIterator = path.pathIterator
Java
Path path = new Path(); path.moveTo(1.0F, 1.0F); path.lineTo(2.0F, 2.0F); path.close(); PathIterator pathIterator = path.getPathIterator();
Em seguida, chame PathIterator
para iterar os segmentos um por um, recuperando todos os dados necessários para cada segmento. Este exemplo
usa objetos PathIterator.Segment
, que empacotam os dados
para você:
Kotlin
for (segment in pathIterator) { println("segment: ${segment.verb}, ${segment.points}") }
Java
while (pathIterator.hasNext()) { PathIterator.Segment segment = pathIterator.next(); Log.i(LOG_TAG, "segment: " + segment.getVerb() + ", " + segment.getPoints()); }
O PathIterator
também tem uma versão não alocada de next()
, em que é possível transmitir
um buffer para armazenar os dados dos pontos.
Um dos casos de uso importantes para consultar os dados Path
é a interpolação. Por
exemplo, você pode querer animar (ou transformar) entre dois caminhos diferentes. Para
simplificar ainda mais esse caso de uso, o Android 14 também inclui o
método interpolate()
em Path
. Supondo que os dois caminhos tenham
a mesma estrutura interna, o método interpolate()
cria um novo Path
com esse resultado interpolado. Este exemplo retorna um caminho com um formato que está
na metade do caminho (uma interpolação linear de 0,5) entre path
e otherPath
:
Kotlin
val interpolatedResult = Path() if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, .5f, interpolatedResult) }
Java
Path interpolatedResult = new Path(); if (path.isInterpolatable(otherPath)) { path.interpolate(otherPath, 0.5F, interpolatedResult); }
A biblioteca graphics-path do Jetpack também permite APIs semelhantes em versões anteriores do Android.
Malhas personalizadas com sombreadores de vértice e fragmento
Android 长期以来一直支持使用自定义着色绘制三角网格,但输入网格格式仅限于一些预定义的属性组合。Android 14 增加了对自定义网格的支持,可将其定义为三角形或三角形条,并且可以选择是否编入索引。这些网格是使用自定义属性、顶点步长、可变以及使用 AGSL 编写的顶点着色器和片段着色器指定的。
顶点着色器定义了位置和颜色等变量,而片段着色器可以选择为像素定义颜色,通常是使用顶点着色器创建的变量。如果片段着色器提供颜色,则系统会使用绘制网格时选择的混合模式将其与当前 Paint
颜色混合。Uniform 可以传递到片段着色器和顶点着色器,以提高灵活性。
Renderizador de buffer de hardware para Canvas
Para ajudar no uso da API Canvas
do Android para desenhar com
aceleração de hardware em um HardwareBuffer
, Android 14
apresenta o HardwareBufferRenderer
. Essa API é
particularmente útil quando seu caso de uso envolve a comunicação com o compositor
do sistema usando SurfaceControl
para renderização
de baixa latência.