Android 16 面向开发者引入了一些出色的新功能和 API。以下部分总结了这些功能,可帮助您开始使用相关 API。
如需详细了解新增、修改和移除的 API,请参阅 API 差异报告。如需详细了解新的 API,请访问 Android API 参考文档,新 API 会突出显示以方便查看。您还应查看平台变更可能会在哪些方面影响您的应用。如需了解详情,请参阅以下页面:
核心功能
Android 包含可扩展 Android 系统核心功能的新 API。
2025 年发布两个 Android API
- This preview is for the next major release of Android with a planned launch in Q2 of 2025. This release is similar to all of our API releases in the past, where we can have planned behavior changes that are often tied to a targetSdkVersion.
- We're planning the major release a quarter earlier (Q2 rather than Q3 in prior years) to better align with the schedule of device launches across our ecosystem, so more devices can get the major release of Android sooner. With the major release coming in Q2, you'll need to do your annual compatibility testing a few months earlier than in previous years to make sure your apps are ready.
- We plan to have another release in Q4 of 2025 which also will include new developer APIs. The Q2 major release will be the only release in 2025 to include planned behavior changes that could affect apps.
In addition to new developer APIs, the Q4 minor release will pick up feature updates, optimizations, and bug fixes; it will not include any app-impacting behavior changes.

We'll continue to have quarterly Android releases. The Q1 and Q3 updates in-between the API releases will provide incremental updates to help ensure continuous quality. We're actively working with our device partners to bring the Q2 release to as many devices as possible.
Using new APIs with major and minor releases
Guarding a code block with a check for API level is done today using
the SDK_INT
constant with
VERSION_CODES
. This will continue
to be supported for major Android releases.
if (SDK_INT >= VERSION_CODES.BAKLAVA) {
// Use APIs introduced in Android 16
}
The new SDK_INT_FULL
constant can be used for API checks against both major and minor versions with
the new VERSION_CODES_FULL
enumeration.
if (SDK_INT_FULL >= VERSION_CODES_FULL.[MAJOR or MINOR RELEASE]) {
// Use APIs introduced in a major or minor release
}
You can also use the
Build.getMinorSdkVersion()
method to get just the minor SDK version.
val minorSdkVersion = Build.getMinorSdkVersion(VERSION_CODES_FULL.BAKLAVA)
These APIs have not yet been finalized and are subject to change, so please send us feedback if you have any concerns.
用户体验和系统界面
Android 16 让应用开发者和用户可以更好地控制和灵活地配置设备,以满足他们的需求。
以进度为中心的通知
Android 16 introduces progress-centric notifications to help users seamlessly track user-initiated, start-to-end journeys.
Notification.ProgressStyle
is a new notification
style that lets you create progress-centric notifications. Key use cases include
rideshare, delivery, and navigation. Within the Notification.ProgressStyle
class, you can denote states and milestones in a user journey using
points and segments.
To learn more, see the Progress-centric notifications documentation page.


预测性返回更新
Android 16 adds new APIs to help you enable predictive back system animations in
gesture navigation such as the back-to-home animation. Registering the
onBackInvokedCallback
with the new
PRIORITY_SYSTEM_NAVIGATION_OBSERVER
allows your app to
receive the regular onBackInvoked
call whenever the
system handles a back navigation without impacting the normal back navigation
flow.
Android 16 additionally adds the
finishAndRemoveTaskCallback()
and
moveTaskToBackCallback
. By registering these callbacks
with the OnBackInvokedDispatcher
, the system can trigger
specific behaviors and play corresponding ahead-of-time animations when the back
gesture is invoked.
更丰富的触感反馈
自诞生之日起,Android 就提供了对触感反馈致动器的控制。
Android 11 添加了对更复杂的触感反馈效果的支持,更高级的致动器可以通过设备定义的语义基元 VibrationEffect.Compositions
支持这些效果。
Android 16 添加了触感反馈 API,让应用能够定义触感反馈效果的振幅和频率曲线,同时抽象出设备功能之间的差异。
开发者工作效率和工具
虽然我们为提高开发者效率所做的大部分工作都集中在 Android Studio、Jetpack Compose 和 Android Jetpack 库等工具上,但我们始终在寻找各种方法,通过平台帮助您实现愿景。
动态壁纸的内容处理
在 Android 16 中,动态壁纸框架将获得一个新的 content API,以应对由用户驱动的动态壁纸带来的挑战。目前,包含用户提供的内容的实时壁纸需要复杂的服务专用实现。Android 16 引入了 WallpaperDescription
和 WallpaperInstance
。借助 WallpaperDescription,您可以识别同一服务中的动态壁纸的不同实例。例如,如果某张壁纸同时在主屏幕和锁定屏幕上显示,则这两种情况下显示的内容可能各不相同。壁纸选择器和 WallpaperManager
会使用此元数据更好地向用户呈现壁纸,从而简化创建多样化个性化动态壁纸体验的过程。
性能和电池
Android 16 引入了一些 API,可帮助您收集有关应用的数据分析。
系统触发的性能分析
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.
在 ApplicationStartInfo 中启动组件
ApplicationStartInfo
在 Android 15 中添加,可让应用查看进程启动原因、启动类型、启动时间、节流和其他实用诊断数据。Android 16 添加了 getStartComponent()
,用于区分触发启动的组件类型,这有助于优化应用的启动流程。
更好的作业自省
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.
自适应刷新率
Adaptive refresh rate (ARR), introduced in Android 15, enables the display refresh rate on supported hardware to adapt to the content frame rate using discrete VSync steps. This reduces power consumption while eliminating the need for potentially jank-inducing mode-switching.
Android 16 introduces hasArrSupport()
and
getSuggestedFrameRate(int)
while restoring
getSupportedRefreshRates()
to make it easier for your apps to take
advantage of ARR. RecyclerView
1.4 internally supports ARR when it is settling from a fling or
smooth scroll, and we're continuing our work to add ARR
support into more Jetpack libraries. This frame rate article covers
many of the APIs you can use to set the frame rate so that your app can directly
use ARR.
ADPF 中的 Headroom API
The SystemHealthManager
introduces the
getCpuHeadroom
and
getGpuHeadroom
APIs, designed to provide games and
resource-intensive apps with estimates of available CPU and GPU resources. These
methods offer a way for you to gauge how your app or game can best improve
system health, particularly when used in conjunction with other Android Dynamic
Performance Framework (ADPF) APIs that detect thermal
throttling.
By using CpuHeadroomParams
and
GpuHeadroomParams
on supported devices, you can
customize the time window used to compute the headroom and select between
average or minimum resource availability. This can help you reduce your CPU or
GPU resource usage accordingly, leading to better user experiences and improved
battery life.
无障碍
Android 16 添加了新的无障碍功能 API 和功能,可帮助您面向每位用户提供应用。
改进了无障碍功能 API
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
,以便应用可以告知无障碍服务需要输入表单字段。对于填写各种类型表单的用户而言,这是一个重要的场景,即使是简单的必填条款及条件复选框,也能帮助用户始终如一地识别必填字段并在必填字段之间快速导航。
使用 LEA 助听器进行语音通话时,将手机用作麦克风输入
Android 16 新增了一项功能,让 LE Audio 助听器用户能够在助听器的内置麦克风和手机上的麦克风之间切换,以进行语音通话。在嘈杂的环境或助听器麦克风可能无法正常工作的其他情况下,这会很有帮助。
LEA 助听器的环境音量控制
Android 16 新增了一项功能,可让 LE Audio 助听器用户调节助听器麦克风接收的环境声音的音量。在背景噪音过大或过小的情况下,这可能会很有用。
相机
Android 16 增强了对专业相机用户的支持,支持混合自动曝光以及精确的色温和色调调整。新的夜间模式指示器可帮助应用了解何时切换到夜间模式相机会话以及何时从夜间模式相机会话切换出去。新的 Intent
操作让您可以更轻松地拍摄动态照片,我们还将继续改进 UltraHDR 图片,使其支持 HEIC 编码和 ISO 21496-1 草稿标准中的新参数。
混合自动曝光
Android 16 向 Camera2 添加了新的混合自动曝光模式,让您可以手动控制曝光的特定方面,同时让自动曝光 (AE) 算法处理其余部分。您可以控制 ISO + AE 和曝光时间 + AE,与当前方法(您要么完全手动控制,要么完全依赖自动曝光)相比,可提供更大的灵活性。
public void setISOPriority() {
...
int[] availablePriorityModes =
mStaticInfo.getCharacteristics().get(CameraCharacteristics.
COLOR_AE_AVAILABLE_PRIORITY_MODES);
...
// 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);
reqBuilder.set(CaptureRequest.SENSOR_SENSITIVITY,
TEST_SENSITIVITY_VALUE);
CaptureRequest request = reqBuilder.build();
...
}
精确调整色温和色调
Android 16 增加了对相机的精细色温和色调调整的支持,以更好地支持专业视频录制应用。在较低版本的 Android 中,您可以通过 CONTROL_AWB_MODE
控制白平衡设置,其中包含仅限于预设列表的选项,例如白炽灯、多云和黄昏。COLOR_CORRECTION_MODE_CCT
可让您使用 COLOR_CORRECTION_COLOR_TEMPERATURE
和 COLOR_CORRECTION_COLOR_TINT
根据相关色温精确调整白平衡。
public void setCCT() {
...
Range<Integer> colorTemperatureRange =
mStaticInfo.getCharacteristics().get(CameraCharacteristics.
COLOR_CORRECTION_COLOR_TEMPERATURE_RANGE);
// Set to manual mode to enable CCT mode
reqBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CameraMetadata.CONTROL_AWB_MODE_OFF);
reqBuilder.set(CaptureRequest.COLOR_CORRECTION_MODE,
CameraMetadata.COLOR_CORRECTION_MODE_CCT);
reqBuilder.set(CaptureRequest.COLOR_CORRECTION_COLOR_TEMPERATURE, 5000);
reqBuilder.set(CaptureRequest.COLOR_CORRECTION_COLOR_TINT, 30);
CaptureRequest request = reqBuilder.build();
...
}
以下示例展示了应用不同色温和色调调整后的照片效果:





相机夜间模式取景检测
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.
动态照片拍摄 intent 操作
Android 16 adds standard Intent actions —
ACTION_MOTION_PHOTO_CAPTURE
, and
ACTION_MOTION_PHOTO_CAPTURE_SECURE
— which request that
the camera application capture a motion photo and return
it.
You must either pass an extra EXTRA_OUTPUT
to control
where the image will be written, or a Uri
through
Intent.setClipData(ClipData)
. If you don't set a
ClipData
, it will be copied there for you when calling
Context.startActivity(Intent)
.
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.
图形
Android 16 包含最新的图形改进,例如使用 AGSL 的自定义图形效果。
使用 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
}
连接
Android 16 更新了平台,让您的应用可以使用通信和无线技术的最新进展。
增强型安全范围测算
Android 16 在搭载 Wi-Fi 6 的 802.11az 的受支持设备上为 Wi-Fi 位置信息添加了对强大的安全功能的支持,让应用能够将该协议的更高精确性、更高可伸缩性和动态调度与安全增强功能(包括基于 AES-256 的加密和防范中间人攻击)相结合。这样,在近距离使用情形(例如解锁笔记本电脑或车门)时,便可更安全地使用该功能。802.11az 与 Wi-Fi 6 标准集成,可利用其基础架构和功能实现更广泛的采用和更轻松的部署。
通用测距 API
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.
媒体
Android 16 包含多种可改善媒体体验的功能。
改进了照片选择器
The photo picker provides a safe, built-in way for users to grant your app access to selected images and videos from both local and cloud storage, instead of their entire media library. Using a combination of Modular System Components through Google System Updates and Google Play services, it's supported back to Android 4.4 (API level 19). Integration requires just a few lines of code with the associated Android Jetpack library.
Android 16 includes the following improvements to the photo picker:
- Embedded photo picker: New APIs that enable apps to embed the photo picker into their view hierarchy. This allows it to feel like a more integrated part of the app while still leveraging the process isolation that allows users to select media without the app needing overly broad permissions. To maximize compatibility across platform versions and simplify your integration, you'll want to use the forthcoming Android Jetpack library if you want to integrate the embedded photo picker.
- Cloud search in photo picker: New APIs that enable searching from the cloud media provider for the Android photo picker. Search functionality in the photo picker is coming soon.
高级专业视频
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.
隐私设置
Android 16 包含多种功能,可帮助应用开发者保护用户隐私。
健康数据共享更新
Health Connect in the developer preview adds ACTIVITY_INTENSITY
, a new
data type defined according to World Health Organization guidelines around
moderate and vigorous activity. Each record requires the start time, the end
time and whether the activity intensity is moderate or vigorous.
Health Connect also contains updated APIs supporting health records. This allows apps to read and write medical records in FHIR format with explicit user consent. This API is in an early access program. If you'd like to participate, sign up to be part of our early access program.
Privacy Sandbox on 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.
安全
Android 16 包含一些功能,可帮助您增强应用的安全性并保护应用的数据。
密钥共享 API
Android 16 添加了一些 API,这些 API 支持与其他应用共享对 Android Keystore 密钥的访问权限。新的 KeyStoreManager
类支持按应用 uid 授予和撤消对密钥的访问权限,并包含一个供应用访问共享密钥的 API。
设备规格
Android 16 为您的应用提供了支持,可让应用充分利用 Android 的设备规格。
适用于电视的标准化画质和音质框架
Android 16 中的新 MediaQuality
软件包公开了一组标准化 API,用于访问音频和图片配置文件以及与硬件相关的设置。这样,在线播放应用就可以查询配置文件并将其动态应用于媒体:
- 使用更大动态范围进行母版制作的电影需要更高的色彩准确度,才能看清阴影中的细微细节并根据环境光线进行调整,因此,最好使用色彩准确度优先于亮度的配置文件。
- 体育赛事直播通常采用较窄的动态范围进行母版制作,但通常是在白天观看,因此偏向亮度而非色彩准确度的配置文件可以获得更好的效果。
- 完全交互式内容需要尽可能减少处理以缩短延迟时间,并且需要更高的帧速率,因此许多电视都附带游戏配置文件。
借助此 API,应用可以在个人资料之间切换,用户可以享受调整支持的电视,以便尽可能适合其内容。
国际化
Android 16 添加了一些功能,可在用户使用不同语言使用设备时提升用户体验。
垂直文本
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
)
}
}
) {}
自定义衡量系统
用户现在可以在“设置”中的地区偏好设置中自定义测量系统。用户偏好设置包含在语言区域代码中,因此您可以在 ACTION_LOCALE_CHANGED
上注册 BroadcastReceiver
,以便在地区偏好设置发生更改时处理语言区域配置更改。
使用格式设置程序有助于提供符合当地体验的服务。例如,对于将手机设置为英语(丹麦)或将手机设置为英语(美国)并将公制作为首选测量系统的用户,“0.5 in”的英语(美国)对应于“12,7 mm”。
如需找到这些设置,请打开“设置”应用,然后依次前往系统 > 语言和地区。