O Android 16 introduz ótimos recursos e APIs novos para desenvolvedores. As seções a seguir resumem 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 APIs novas estão em destaque para melhor visibilidade.Você também precisa analisar as áreas em que as mudanças na plataforma podem afetar seus apps. Para mais informações, consulte as seguintes páginas:
- Mudanças de comportamento que afetam apps destinados ao Android 16
- Mudanças de comportamento que afetam todos os apps, independente da
targetSdkVersion
.
Principal recurso
O Android inclui novas APIs que expandem os recursos principais do sistema Android.
Dois lançamentos de APIs do Android em 2025
- 此预览版适用于 Android 的下一个主要版本,计划于 2025 年第 2 季度发布。此版本与我们过去的所有 API 版本类似,我们可以进行计划性的行为更改,这些更改通常与 targetSdkVersion 相关联。
- 我们计划提前一个季度(2021 年第 2 季度,而非之前的第 3 季度)发布主要版本,以便更好地与整个生态系统中的设备发布时间表保持一致,让更多设备能够更早地搭载 Android 主要版本。由于主要版本将于第 2 季度发布,因此您需要比往年提前几个月进行年度兼容性测试,以确保您的应用已做好准备。
- 我们计划在 2025 年第 4 季度再发布一次,届时还将推出新的开发者 API。2025 年只有第二季度的主要版本包含可能影响应用的计划行为变更。
除了新的开发者 API 之外,第 4 季度次要版本还将包含功能更新、优化和 bug 修复;其中不会包含任何会影响应用的行为变更。

我们将继续每季度发布 Android 版本。在 API 版本之间,第 1 季度和第 3 季度的更新将提供增量更新,以帮助确保持续提供高质量的服务。我们正积极与设备合作伙伴合作,将 Q2 版本推广到尽可能多的设备。
在主要版本和次要版本中使用新 API
目前,使用 SDK_INT
常量与 VERSION_CODES
结合使用,即可通过检查 API 级别来保护代码块。我们将继续支持主要 Android 版本。
if (SDK_INT >= VERSION_CODES.BAKLAVA) {
// Use APIs introduced in Android 16
}
新的 SDK_INT_FULL
常量可用于针对主要版本和次要版本进行 API 检查,并使用新的 VERSION_CODES_FULL
枚举。
if (SDK_INT_FULL >= VERSION_CODES_FULL.[MAJOR or MINOR RELEASE]) {
// Use APIs introduced in a major or minor release
}
您还可以使用 Build.getMinorSdkVersion()
方法仅获取 SDK 次要版本。
val minorSdkVersion = Build.getMinorSdkVersion(VERSION_CODES_FULL.BAKLAVA)
这些 API 尚未最终确定,可能会发生变化,因此如果您有任何疑虑,请向我们发送反馈。
Experiência do usuário e interface do sistema
O Android 16 oferece aos desenvolvedores de apps e usuários mais controle e flexibilidade para configurar o dispositivo de acordo com as necessidades.
Notificações focadas no progresso
Android 16 引入了以进度为中心的通知,可帮助用户顺畅地跟踪用户发起的端到端历程。
Notification.ProgressStyle
是一种新的通知样式,可让您创建以进度为中心的通知。主要用例包括共享车辆、送货和导航。在 Notification.ProgressStyle
类中,您可以使用点和细分来表示用户体验历程中的状态和里程碑。
To learn more, see the Progress-centric notifications documentation page.


Atualizações de volta preditiva
O Android 16 adiciona novas APIs para ajudar a ativar animações de volta preditiva do sistema na
navegação por gestos, como a animação de volta à tela inicial. Registrar o
onBackInvokedCallback
com o novo
PRIORITY_SYSTEM_NAVIGATION_OBSERVER
permite que o app
receba a chamada onBackInvoked
normal sempre que o
sistema processa uma navegação de retorno sem afetar o fluxo normal de navegação
de retorno.
O Android 16 também adiciona o
finishAndRemoveTaskCallback()
e o
moveTaskToBackCallback
. Ao registrar esses callbacks
com o OnBackInvokedDispatcher
, o sistema pode acionar
comportamentos específicos e reproduzir animações antecipadas correspondentes quando o gesto
de voltar é invocado.
Retorno tátil mais avançado
Android has exposed control over the haptic actuator ever since its inception.
Android 11 added support for more complex haptic effects that more advanced
actuators could support through
VibrationEffect.Compositions
of device-defined semantic
primitives.
Android 16 adds haptic APIs that let apps define the amplitude and frequency curves of a haptic effect while abstracting away differences between device capabilities.
Produtividade e ferramentas para desenvolvedores
Embora a maior parte do nosso trabalho para melhorar sua produtividade se concentre em ferramentas como o Android Studio, o Jetpack Compose e as bibliotecas do Android Jetpack, sempre buscamos maneiras na plataforma de ajudar você a realizar sua visão.
Processamento de conteúdo para planos de fundo interativos
在 Android 16 中,动态壁纸框架将获得一个新的 content API,以应对由用户驱动的动态壁纸带来的挑战。目前,包含用户提供的内容的实时壁纸需要复杂的服务专用实现。Android 16 引入了 WallpaperDescription
和 WallpaperInstance
。借助 WallpaperDescription,您可以识别同一服务中的动态壁纸的不同实例。例如,如果某张壁纸同时在主屏幕和锁定屏幕上显示,则这两种情况下显示的内容可能各不相同。壁纸选择器和 WallpaperManager
会使用此元数据更好地向用户呈现壁纸,从而简化创建多样化个性化动态壁纸体验的过程。
Desempenho e bateria
O Android 16 apresenta APIs que ajudam a coletar insights sobre seus apps.
Criação de perfis acionada pelo sistema
ProfilingManager
was
added in Android 15, giving apps the ability to
request profiling data collection using Perfetto on public devices in the field.
However, since this profiling must be started from the app, critical flows such
as startups or ANRs would be difficult or impossible for apps to capture.
To help with this, Android 16 introduces system-triggered profiling to
ProfilingManager
. Apps can register interest in receiving traces for certain
triggers such as cold start reportFullyDrawn
or ANRs, and then the system starts and stops a trace on the app's behalf. After
the trace completes, the results are delivered to the app's data directory.
Iniciar componente em ApplicationStartInfo
ApplicationStartInfo
was added in Android
15, allowing an app to see reasons
for process start, start type, start times, throttling, and other useful
diagnostic data. Android 16 adds
getStartComponent()
to distinguish what component type triggered the start, which can be helpful for
optimizing the startup flow of your app.
Melhor introspecção de tarefas
The JobScheduler#getPendingJobReason()
API returns a reason why a job
might be pending. However, a job might be pending for multiple reasons.
In Android 16, we are introducing a new API
JobScheduler#getPendingJobReasons(int jobId)
, which returns multiple
reasons why a job is pending, due to both explicit constraints set by the
developer and implicit constraints set by the system.
We're also introducing
JobScheduler#getPendingJobReasonsHistory(int jobId)
, which returns a list
of the most recent constraint changes.
We recommend using the API to help you debug why your jobs may not be executing, especially if you're seeing reduced success rates of certain tasks or have bugs around latency of certain job completion. For example, updating widgets in the background failed to occur or prefetch job failed to be called prior to app start.
This can also better help you understand if certain jobs are not completing due to system defined constraints versus explicitly set constraints.
Taxa de Atualização Adaptativa
A taxa de atualização adaptativa (ARR, na sigla em inglês), introduzida no Android 15, permite que a taxa de atualização da tela em hardwares com suporte se adapte à taxa de frames do conteúdo usando passos discretos de VSync. Isso reduz o consumo de energia e elimina a necessidade de alternar entre modos que podem causar instabilidade.
O Android 16 apresenta hasArrSupport()
e
getSuggestedFrameRate(int)
, além de restaurar
getSupportedRefreshRates()
para facilitar o uso do ARR
nos apps. O RecyclerView
1.4 oferece suporte interno ao ARR quando ele é definido por um movimento rápido ou
rolagem suave. Continuamos trabalhando para adicionar suporte
ao ARR em mais bibliotecas do Jetpack. Este artigo sobre frame rate aborda
muitas das APIs que podem ser usadas para definir a frame rate para que o app possa usar
diretamente o ARR.
APIs de headroom na ADPF
SystemHealthManager
引入了 getCpuHeadroom
和 getGpuHeadroom
API,旨在为游戏和资源密集型应用提供可用 CPU 和 GPU 资源的估算值。通过这些方法,您可以评估应用或游戏如何以最佳方式改善系统运行状况,尤其是在与用于检测热节流的其他 Android 动态性能框架 (ADPF) API 搭配使用时。
在受支持的设备上使用 CpuHeadroomParams
和 GpuHeadroomParams
,您可以自定义用于计算余量的时间范围,并在平均资源可用性或最低资源可用性之间进行选择。这有助于您相应地减少 CPU 或 GPU 资源用量,从而提升用户体验并延长电池续航时间。
Acessibilidade
O Android 16 adiciona novas APIs e recursos de acessibilidade que podem ajudar você a levar seu app para todos os usuários.
APIs de acessibilidade aprimoradas
Android 16 添加了其他 API 来增强界面语义,这有助于为依赖于无障碍服务(例如 TalkBack)的用户提高一致性。
为文字添加轮廓,以最大限度地提高文字对比度
视力较低的用户对对比度的敏感度通常较低,因此很难将对象与背景区分开来。为了帮助这些用户,Android 16 引入了轮廓文本,取代了高对比度文本,后者会在文本周围绘制较大的对比度区域,以大大提高可辨性。
Android 16 包含新的 AccessibilityManager
API,可让您的应用检查或注册监听器,以查看此模式是否已启用。这主要适用于 Compose 等界面工具包,以提供类似的视觉体验。如果您维护界面工具包库,或者您的应用执行绕过 android.text.Layout
类的自定义文本渲染,则可以使用此方法来了解何时启用轮廓文本。

向 TtsSpan 添加了时长
Android 16 使用 TYPE_DURATION
扩展了 TtsSpan
,其中包含 ARG_HOURS
、ARG_MINUTES
和 ARG_SECONDS
。这样,您就可以直接为时长添加注释,确保通过 TalkBack 等服务获得准确且一致的文本转语音输出。
支持具有多个标签的元素
Android 目前允许界面元素从其他元素派生其无障碍功能标签,现在还支持关联多个标签,这是 Web 内容中常见的情况。通过在 AccessibilityNodeInfo
中引入基于列表的 API,Android 可以直接支持这些多标签关系。在进行这项更改的过程中,我们已弃用 AccessibilityNodeInfo#setLabeledBy
和 #getLabeledBy
,改用 #addLabeledBy
、#removeLabeledBy
和 #getLabeledByList
。
改进了对可展开元素的支持
Android 16 添加了无障碍功能 API,可让您传达互动元素(例如菜单和展开式列表)的展开或收起状态。通过使用 setExpandedState
设置展开状态,并使用 CONTENT_CHANGE_TYPE_EXPANDED
内容更改类型调度 TYPE_WINDOW_CONTENT_CHANGED AccessibilityEvents,您可以确保 TalkBack 等屏幕阅读器会读出状态更改,从而提供更直观、更包容的用户体验。
不确定进度条
Android 16 添加了 RANGE_TYPE_INDETERMINATE
,让您可以为确定性和不确定性 ProgressBar
微件公开 RangeInfo
,从而让 TalkBack 等服务能够更一致地为进度指示器提供反馈。
三态复选框
Android 16 中的新 AccessibilityNodeInfo
getChecked
和 setChecked(int)
方法现在除了“已选中”和“未选中”之外,还支持“部分选中”状态。此字段取代了已废弃的布尔值 isChecked
和 setChecked(boolean)
。
补充说明
如果无障碍服务提供关于 ViewGroup
的说明,则会将来自其子视图的内容标签合并在一起。如果您为 ViewGroup
提供 contentDescription
,无障碍服务会假定您还要覆盖不可聚焦的子视图的说明。如果您想为下拉菜单等内容添加标签(例如“字体系列”),同时保留当前的无障碍功能选择(例如“Roboto”),这可能会造成问题。Android 16 添加了 setSupplementalDescription
,以便您提供用于提供 ViewGroup
相关信息的文本,而不会覆盖其子项中的信息。
必填表单字段
Android 16 向 AccessibilityNodeInfo
添加了 setFieldRequired
,以便应用可以告知无障碍服务需要输入表单字段。对于填写各种类型表单的用户而言,这是一个重要的场景,即使是简单的必填条款及条件复选框,也能帮助用户始终如一地识别必填字段并在必填字段之间快速导航。
Usar o smartphone como entrada de microfone para chamadas de voz com aparelhos auditivos LEA
Android 16 adds the capability for users of LE Audio hearing aids to switch between the built-in microphones on the hearing aids and the microphone on their phone for voice calls. This can be helpful in noisy environments or other situations where the hearing aid's microphones might not perform well.
Controles de volume ambiente para aparelhos auditivos LEA
Android 16 新增了一项功能,可让 LE Audio 助听器用户调节助听器麦克风接收的环境声音的音量。在背景噪音过大或过小的情况下,这可能会很有用。
Câmera
O Android 16 melhora o suporte para usuários de câmeras profissionais, permitindo a exposição automática híbrida, além de ajustes precisos de temperatura e tonalidade de cor. Um novo indicador de modo noturno ajuda o app a saber quando alternar entre uma sessão de câmera normal e uma de modo noturno. Novas ações de Intent
facilitam a captura de fotos em movimento, e continuamos a melhorar as imagens UltraHDR com suporte à codificação HEIC e novos parâmetros do padrão ISO 21496-1.
Exposição automática híbrida
Android 16 向 Camera2 添加了新的混合自动曝光模式,让您可以手动控制曝光的特定方面,同时让自动曝光 (AE) 算法处理其余部分。您可以控制 ISO + AE 和曝光时间 + AE,与当前方法(您要么完全手动控制,要么完全依赖自动曝光)相比,可提供更大的灵活性。
fun setISOPriority() {
// ... (Your existing code before the snippet) ...
val availablePriorityModes = mStaticInfo.characteristics.get(
CameraCharacteristics.CONTROL_AE_AVAILABLE_PRIORITY_MODES
)
// ... (Your existing code between the snippets) ...
// Turn on AE mode to set priority mode
reqBuilder.set(
CaptureRequest.CONTROL_AE_MODE,
CameraMetadata.CONTROL_AE_MODE_ON
)
reqBuilder.set(
CaptureRequest.CONTROL_AE_PRIORITY_MODE,
CameraMetadata.CONTROL_AE_PRIORITY_MODE_SENSOR_SENSITIVITY_PRIORITY
)
reqBuilder.set(
CaptureRequest.SENSOR_SENSITIVITY,
TEST_SENSITIVITY_VALUE
)
val request: CaptureRequest = reqBuilder.build()
// ... (Your existing code after the snippet) ...
}
Ajustes precisos de temperatura e tonalidade da cor
Android 16 增加了对相机的精细色温和色调调整的支持,以更好地支持专业视频录制应用。在较低版本的 Android 中,您可以通过 CONTROL_AWB_MODE
控制白平衡设置,其中包含仅限于预设列表的选项,例如白炽灯、多云和黄昏。COLOR_CORRECTION_MODE_CCT
可让您使用 COLOR_CORRECTION_COLOR_TEMPERATURE
和 COLOR_CORRECTION_COLOR_TINT
根据相关色温精确调整白平衡。
fun setCCT() {
// ... (Your existing code before this point) ...
val colorTemperatureRange: Range<Int> =
mStaticInfo.characteristics[CameraCharacteristics.COLOR_CORRECTION_COLOR_TEMPERATURE_RANGE]
// Set to manual mode to enable CCT mode
reqBuilder[CaptureRequest.CONTROL_AWB_MODE] = CameraMetadata.CONTROL_AWB_MODE_OFF
reqBuilder[CaptureRequest.COLOR_CORRECTION_MODE] = CameraMetadata.COLOR_CORRECTION_MODE_CCT
reqBuilder[CaptureRequest.COLOR_CORRECTION_COLOR_TEMPERATURE] = 5000
reqBuilder[CaptureRequest.COLOR_CORRECTION_COLOR_TINT] = 30
val request: CaptureRequest = reqBuilder.build()
// ... (Your existing code after this point) ...
}
以下示例展示了应用不同色温和色调调整后的照片效果:





Detecção de cena no modo noturno da câmera
To help your app know when to switch to and from a night mode camera session,
Android 16 adds EXTENSION_NIGHT_MODE_INDICATOR
. If
supported, it's available in the CaptureResult
within
Camera2.
This is the API we briefly mentioned as coming soon in the How Instagram enabled users to take stunning low light photos blog post. That post is a practical guide on how to implement night mode together with a case study that links higher-quality in-app night mode photos with an increase in the number of photos shared from the in-app camera.
Ações de intent de captura de fotos com movimento
Android 16 添加了标准 intent 操作 ACTION_MOTION_PHOTO_CAPTURE
和 ACTION_MOTION_PHOTO_CAPTURE_SECURE
,用于请求相机应用拍摄动态照片并将其返回。
您必须传递额外的 EXTRA_OUTPUT
来控制将图片写入的位置,或者通过 Intent.setClipData(ClipData)
传递 Uri
。如果您未设置 ClipData
,系统会在调用 Context.startActivity(Intent)
时将其复制到该位置。
Melhorias de imagem UltraHDR

Android 16 continues our work to deliver dazzling image quality with UltraHDR
images. It adds support for UltraHDR images in the HEIC file
format. These images will get ImageFormat
type
HEIC_ULTRAHDR
and will contain an embedded gainmap similar
to the existing UltraHDR JPEG format. We're working on AVIF support for UltraHDR
as well, so stay tuned.
In addition, Android 16 implements additional parameters in UltraHDR from the ISO 21496-1 draft standard, including the ability to get and set the colorspace that gainmap math should be applied in, as well as support for HDR encoded base images with SDR gainmaps.
Gráficos
O Android 16 inclui as melhorias gráficas mais recentes, como efeitos gráficos personalizados com a AGSL.
Efeitos gráficos personalizados com a AGSL
Android 16 添加了 RuntimeColorFilter
和 RuntimeXfermode
,让您可以创作阈值、Sepia 和 Hue Saturation 等复杂效果,并将其应用于绘制调用。从 Android 13 开始,您可以使用 AGSL 创建扩展 Shader
的自定义 RuntimeShader。新 API 反映了这一点,添加了由 AGSL 驱动的 RuntimeColorFilter
(用于扩展 ColorFilter
)和 Xfermode
效果,让您可以在源像素和目标像素之间实现基于 AGSL 的自定义合成和混合。
private val thresholdEffectString = """
uniform half threshold;
half4 main(half4 c) {
half luminosity = dot(c.rgb, half3(0.2126, 0.7152, 0.0722));
half bw = step(threshold, luminosity);
return bw.xxx1 * c.a;
}"""
fun setCustomColorFilter(paint: Paint) {
val filter = RuntimeColorFilter(thresholdEffectString)
filter.setFloatUniform(0.5);
paint.colorFilter = filter
}
Conectividade
O Android 16 atualiza a plataforma para dar ao seu app acesso aos mais recentes avanços em tecnologias de comunicação e sem fio.
Intervalo com segurança reforçada
Android 16 adds support for robust security features in Wi-Fi location on supported devices with Wi-Fi 6's 802.11az, allowing apps to combine the higher accuracy, greater scalability, and dynamic scheduling of the protocol with security enhancements including AES-256-based encryption and protection against MITM attacks. This allows it to be used more safely in proximity use cases, such as unlocking a laptop or a vehicle door. 802.11az is integrated with the Wi-Fi 6 standard, leveraging its infrastructure and capabilities for wider adoption and easier deployment.
APIs de intervalo genéricas
Android 16 includes the new RangingManager
, which provides
ways to determine the distance and angle on supported hardware between the local
device and a remote device. RangingManager
supports the usage of a variety of
ranging technologies such as BLE channel sounding, BLE RSSI-based ranging, Ultra
Wideband, and Wi-Fi round trip time.
Presença do dispositivo no gerenciador de dispositivos complementares
Android 16 中引入了用于绑定配套应用服务的新 API。当 BLE 在范围内且蓝牙处于连接状态时,系统会绑定服务;当 BLE 不在范围内或蓝牙处于断开连接状态时,系统会解除绑定服务。应用将根据各种 DevicePresenceEvent
收到新的 'onDevicePresenceEvent()' 回调。如需了解详情,请参阅 'startObservingDevicePresence(ObservingDevicePresenceRequest)'。
Mídia
O Android 16 inclui vários recursos que melhoram a experiência de mídia.
Melhorias no seletor de fotos
照片选择器为用户提供了一种安全的内置授权方式,让用户可以向应用授予对本地存储空间和云端存储空间中所选图片和视频的访问权限,而不是对整个媒体库的访问权限。通过 Google 系统更新和 Google Play 服务组合使用模块化系统组件,该工具向后支持到 Android 4.4(API 级别 19)。只需几行代码即可与相关的 Android Jetpack 库集成。
Android 16 对照片选择器进行了以下改进:
- 嵌入式照片选择器:新 API,可让应用将照片选择器嵌入其视图层次结构中。这样,它就感觉像是应用中更为集成的一部分,同时仍可利用进程隔离功能,让用户能够选择媒体,而无需应用拥有过于宽泛的权限。为了最大限度地提高跨平台版本的兼容性并简化集成,如果您想集成嵌入式照片选择器,则需要使用即将推出的 Android Jetpack 库。
- 照片选择器中的云搜索:新的 API 可让 Android 照片选择器从云端媒体提供商中进行搜索。照片选择器中的搜索功能即将推出。
Vídeo profissional avançado
Android 16 introduces support for the Advanced Professional Video (APV) codec which is designed to be used for professional level high quality video recording and post production.
The APV codec standard has the following features:
- Perceptually lossless video quality (close to raw video quality)
- Low complexity and high throughput intra-frame-only coding (without pixel domain prediction) to better support editing workflows
- Support for high bit-rate range up to a few Gbps for 2K, 4K and 8K resolution content, enabled by a lightweight entropy coding scheme
- Frame tiling for immersive content and for enabling parallel encoding and decoding
- Support for various chroma sampling formats and bit-depths
- Support for multiple decoding and re-encoding without severe visual quality degradation
- Support multi-view video and auxiliary video like depth, alpha, and preview
- Support for HDR10/10+ and user-defined metadata
A reference implementation of APV is provided through the OpenAPV project. Android 16 will implement support for the APV 422-10 Profile that provides YUV 422 color sampling along with 10-bit encoding and for target bitrates of up to 2Gbps.
Privacidade
O Android 16 inclui vários recursos que ajudam os desenvolvedores de apps a proteger a privacidade dos usuários.
Atualizações do app Conexão Saúde
Health Connect 添加了 ACTIVITY_INTENSITY
,这是一种根据世界卫生组织关于中等强度和剧烈强度活动的指南定义的数据类型。每个记录都需要提供开始时间、结束时间以及活动强度(中等或剧烈)。
Health Connect 还包含支持医疗记录的更新版 API。这样一来,应用便可在征得用户明确同意的情况下,读取和写入 FHIR 格式的医疗记录。
Sandbox de privacidade no Android
Android 16 incorporates the latest version of the Privacy Sandbox on Android, part of our ongoing work to develop technologies where users know their privacy is protected. Our website has more about the Privacy Sandbox on Android developer beta program to help you get started. Check out the SDK Runtime which allows SDKs to run in a dedicated runtime environment separate from the app they are serving, providing stronger safeguards around user data collection and sharing.
Segurança
O Android 16 inclui recursos que ajudam a melhorar a segurança do app e proteger os dados dele.
API de compartilhamento de chaves
Android 16 adds APIs that support sharing access to
Android Keystore keys with other apps. The new
KeyStoreManager
class supports
granting and revoking access to keys
by app uid, and includes an API for apps to access shared
keys.
Formatos de dispositivos
O Android 16 oferece aos seus apps o suporte necessário para aproveitar ao máximo os formatos do Android.
Estrutura padronizada de qualidade de imagem e áudio para TVs
O novo pacote
MediaQuality
no Android 16 expõe
um conjunto de APIs padronizadas para acesso a perfis de áudio e imagem e
configurações relacionadas ao hardware. Isso permite que os apps de streaming consultem perfis e
os apliquem à mídia de forma dinâmica:
- Filmes masterizados com um intervalo dinâmico mais amplo exigem maior precisão de cor para ver detalhes sutis nas sombras e se ajustar à luz ambiente. Portanto, um perfil que prioriza a precisão de cor em vez do brilho pode ser adequado.
- Eventos esportivos ao vivo geralmente são masterizados com um intervalo dinâmico estreito, mas são assistidos durante o dia. Portanto, um perfil que prioriza o brilho em vez da precisão de cores pode gerar resultados melhores.
- O conteúdo totalmente interativo exige um processamento mínimo para reduzir a latência e taxas de quadros mais altas. É por isso que muitas TVs são enviadas com um perfil de jogo.
A API permite que os apps alternem entre perfis, e os usuários podem ajustar as TVs compatíveis para se adequar melhor ao conteúdo.
Internacionalização
O Android 16 adiciona recursos e funcionalidades que complementam a experiência do usuário quando um dispositivo é usado em diferentes idiomas.
Texto vertical
Android 16 adds low-level support for rendering and measuring text vertically to
provide foundational vertical writing support for library developers. This is
particularly useful for languages like Japanese that commonly use vertical
writing systems. A new flag,
VERTICAL_TEXT_FLAG
,
has been added to the Paint
class. When
this flag is set using
Paint.setFlags
, Paint's
text measurement APIs will report vertical advances instead of horizontal
advances, and Canvas
will draw text
vertically.
val text = "「春は、曙。」"
Box(
Modifier.padding(innerPadding).background(Color.White).fillMaxSize().drawWithContent {
drawIntoCanvas { canvas ->
val paint = Paint().apply { textSize = 64.sp.toPx() }
// Draw text vertically
paint.flags = paint.flags or VERTICAL_TEXT_FLAG
val height = paint.measureText(text)
canvas.nativeCanvas.drawText(
text,
0,
text.length,
size.width / 2,
(size.height - height) / 2,
paint
)
}
}
) {}
Personalização do sistema de medição
用户现在可以在“设置”中的地区偏好设置中自定义测量系统。用户偏好设置包含在语言区域代码中,因此您可以在 ACTION_LOCALE_CHANGED
上注册 BroadcastReceiver
,以便在地区偏好设置发生更改时处理语言区域配置更改。
使用格式设置程序有助于提供符合当地体验的服务。例如,对于将手机设置为英语(丹麦)或将手机设置为英语(美国)并将公制作为首选测量系统的用户,“0.5 in”的英语(美国)对应于“12,7 mm”。
如需找到这些设置,请打开“设置”应用,然后依次前往系统 > 语言和地区。