Android 16 では、デベロッパー向けに優れた新しい機能と API が導入されました。以降のセクションでは、関連する API の使用を開始する際に役立つように、これらの機能の概要を説明します。
新しい API、変更された API、削除された API の一覧については、API 差分レポートをご覧ください。新しい API について詳しくは、Android API リファレンスをご覧ください。新しい API は、見つけやすいようにハイライト表示されています。また、プラットフォームの変更がアプリに影響する可能性がある領域も確認する必要があります。詳しくは、次のページをご覧ください。
コア機能
Android には、Android システムのコア機能を拡張する新しい API が含まれています。
2025 年に 2 つの Android API がリリース
- 此预览版适用于 Android 的下一个主要版本,计划于 2025 年第 2 季度发布。此版本与我们过去的所有 API 版本类似,我们可以进行计划性的行为更改,这些更改通常与 targetSdkVersion 相关联。
- 我们计划提前一个季度(2021 年第 2 季度,而非之前的第 3 季度)发布主要版本,以便更好地与整个生态系统中的设备发布时间表保持一致,让更多设备能够更早地搭载 Android 主要版本。由于主要版本将于第 2 季度发布,因此您需要比往年提前几个月进行年度兼容性测试,以确保您的应用已做好准备。
- 我们计划在 2025 年第 4 季度再发布一次,届时还将推出新的开发者 API。2025 年只有第二季度的主要版本包含可能影响应用的计划行为变更。
除了新的开发者 API 之外,第 4 季度次要版本还将包含功能更新、优化和 bug 修复;其中不会包含任何会影响应用的行为变更。
![2025 年 Android 版本的时间轴视图,请注意,25Q2 版本是一个主要版本,25Q4 版本是一个次要版本。](https://developer.android.google.cn/static/about/versions/16/images/2025-releases.png?authuser=2&hl=ja)
我们将继续每季度发布 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 尚未最终确定,可能会发生变化,因此如果您有任何疑虑,请向我们发送反馈。
ユーザー エクスペリエンスとシステム UI
Android 16 では、アプリ デベロッパーとユーザーが、ニーズに合わせてデバイスをより細かく柔軟に構成できるようになりました。
進行状況重視の通知
Android 16 では、ユーザーが開始した、最初から最後までのジャーニーをシームレスに追跡できるように、進行状況重視の通知が導入されています。
Notification.ProgressStyle
は、進行状況重視の通知を作成できる新しい通知スタイルです。主なユースケースには、乗車シェアリング、配達、ナビゲーションなどがあります。Notification.ProgressStyle
クラス内で、ポイントとセグメントを使用して、ユーザー ジャーニー内の状態とマイルストーンを指定できます。
詳細については、進行状況重視の通知のドキュメント ページをご覧ください。
![](https://developer.android.google.cn/static/about/versions/16/images/progress-style-lockscreen.png?authuser=2&hl=ja)
![](https://developer.android.google.cn/static/about/versions/16/images/progress-style-notification-shade.png?authuser=2&hl=ja)
予測型「戻る」の更新
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 が追加されました。これにより、アプリはデバイスの機能の違いを抽象化しながら、ハプティクス エフェクトの振幅と周波数の曲線を定義できます。
デベロッパーの生産性とツール
生産性を向上させるための Google の取り組みのほとんどは、Android Studio、Jetpack Compose、Android Jetpack ライブラリなどのツールに重点を置いていますが、Google は常に、デベロッパーのビジョンの実現を支援する方法についてプラットフォーム内で検討しています。
ライブ壁紙のコンテンツの処理
在 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()
,用于区分触发启动的组件类型,这有助于优化应用的启动流程。
ジョブ内省の改善
JobScheduler#getPendingJobReason()
API 会返回作业可能处于待处理状态的原因。不过,作业处于待处理状态的原因可能有多种。
在 Android 16 中,我们引入了一个新 API JobScheduler#getPendingJobReasons(int jobId)
,该 API 会返回作业处于待处理状态的多种原因,包括开发者设置的显式约束条件和系统设置的隐式约束条件。
我们还引入了 JobScheduler#getPendingJobReasonsHistory(int jobId)
,用于返回最新约束条件更改的列表。
我们建议您使用该 API 来调试作业可能无法执行的原因,尤其是在您发现某些任务的成功率降低或某些作业完成延迟存在 bug 时。例如,未能在后台更新微件,或在应用启动之前未能调用预加载作业。
这还有助于您更好地了解某些作业是否因系统定义的约束条件而无法完成,而不是因明确设置的约束条件而无法完成。
リフレッシュ レートの自動調整
Android 15 で導入されたリフレッシュ レートの自動調整(ARR)により、サポートされているハードウェアのディスプレイのリフレッシュ レートを、個別の VSync ステップを使用してコンテンツのフレームレートに合わせることができます。これにより、消費電力を削減し、ジャンクを引き起こす可能性のあるモード切り替えの必要性を排除できます。
Android 16 では、hasArrSupport()
と getSuggestedFrameRate(int)
が導入され、getSupportedRefreshRates()
が復元されるため、アプリで ARR を簡単に利用できるようになります。RecyclerView 1.4 は、スワイプやスムーズ スクロールからのセットリング時に ARR を内部でサポートしています。Google は、ARR のサポートをさらに多くの Jetpack ライブラリに追加する作業を続けています。こちらのフレームレートに関する記事では、アプリで ARR を直接使用できるようにフレームレートを設定するために使用できる API について説明しています。
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 adds additional APIs to enhance UI semantics that help improve consistency for users that rely on accessibility services, such as TalkBack.
Duration added to TtsSpan
Android 16 extends TtsSpan
with a TYPE_DURATION
,
consisting of ARG_HOURS
, ARG_MINUTES
,
and ARG_SECONDS
. This lets you directly annotate time
duration, ensuring accurate and consistent text-to-speech output with services
like TalkBack.
Support elements with multiple labels
Android currently allows UI elements to derive their accessibility label from
another, and now offers the ability for multiple labels to be associated, a
common scenario in web content. By introducing a list-based API within
AccessibilityNodeInfo
, Android can directly support these
multi-label relationships. As part of this change, we've deprecated
AccessibilityNodeInfo#setLabeledBy
and
#getLabeledBy
in favor of
#addLabeledBy
, #removeLabeledBy
, and
#getLabeledByList
.
Improved support for expandable elements
Android 16 adds accessibility APIs that allow you to convey the expanded or
collapsed state of interactive elements, such as menus and expandable lists. By
setting the expanded state using setExpandedState
and
dispatching TYPE_WINDOW_CONTENT_CHANGED AccessibilityEvents
with a CONTENT_CHANGE_TYPE_EXPANDED
content change type,
you can ensure that screen readers like TalkBack announce
state changes, providing a more intuitive and inclusive user experience.
Indeterminate ProgressBars
Android 16 adds RANGE_TYPE_INDETERMINATE
, giving a way for
you to expose RangeInfo
for both determinate and
indeterminate ProgressBar
widgets, allowing services like
TalkBack to more consistently provide feedback for progress
indicators.
Tri-state CheckBox
The new AccessibilityNodeInfo
getChecked
and setChecked(int)
methods in Android 16 now support a "partially checked" state in addition to
"checked" and "unchecked." This replaces the deprecated boolean
isChecked
and setChecked(boolean)
.
Supplemental descriptions
When an accessibility service describes a ViewGroup
, it
combines content labels from its child views. If you provide a
contentDescription
for the ViewGroup
, accessibility services assume you are
also overriding the description of non-focusable child views. This can be
problematic if you want to label things like a drop-down (for example, "Font
Family") while preserving the current selection for accessibility (for example,
"Roboto"). Android 16 adds setSupplementalDescription
so
you can provide text that provides information about a ViewGroup
without
overriding information from its children.
Required form fields
Android 16 adds setFieldRequired
to
AccessibilityNodeInfo
so apps can tell an accessibility
service that input to a form field is required. This is an important scenario
for users filling out many types of forms, even things as simple as a required
terms and conditions checkbox, helping users to consistently identify and
quickly navigate between required fields.
LEA 補聴器での音声通話のマイク入力としてスマートフォンを使用する
Android 16 では、LE Audio 補聴器のユーザーが、音声通話で補聴器の組み込みマイクとスマートフォンのマイクを切り替えられる機能が追加されています。これは、騒がしい環境や、補聴器のマイクがうまく機能しない可能性があるその他の状況で役立ちます。
LEA 補聴器のアンビエント音量調節
Android 16 では、LE Audio 補聴器のユーザーが、補聴器のマイクによって拾われる周囲の音の音量を調整できる機能が追加されました。これは、背景のノイズがうるさすぎる場合や静かすぎる場合に役立ちます。
カメラ
Android 16 では、プロのカメラユーザー向けのサポートが強化され、ハイブリッド自動露出と、正確な色温度と色合いの調整が可能になりました。新しい夜景モードのインジケーターは、アプリが夜景モードのカメラ セッションとの切り替えを行うタイミングを把握するのに役立ちます。新しい Intent
アクションにより、モーション フォトの撮影が容易になりました。また、HEIC エンコードと ISO 21496-1 ドラフト標準の新しいパラメータのサポートにより、UltraHDR 画像の改善が継続されています。
ハイブリッド自動露出
Android 16 adds new hybrid auto-exposure modes to Camera2, allowing you to manually control specific aspects of exposure while letting the auto-exposure (AE) algorithm handle the rest. You can control ISO + AE, and exposure time + AE, providing greater flexibility compared to the current approach where you either have full manual control or rely entirely on auto-exposure.
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) ...
}
色温度と色合いを正確に調整
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();
...
}
以下示例展示了应用不同色温和色调调整后的照片效果:
![](https://developer.android.google.cn/static/about/versions/16/images/color-temperature-tint.jpg?authuser=2&hl=ja)
![](https://developer.android.google.cn/static/about/versions/16/images/color-temperature-3000.jpg?authuser=2&hl=ja)
![](https://developer.android.google.cn/static/about/versions/16/images/color-temperature-7000.jpg?authuser=2&hl=ja)
![](https://developer.android.google.cn/static/about/versions/16/images/color-tint-minus-50.jpg?authuser=2&hl=ja)
![](https://developer.android.google.cn/static/about/versions/16/images/color-tint-plus-50.jpg?authuser=2&hl=ja)
カメラの夜間モードでのシーン検出
夜間モードのカメラ セッションとの切り替えタイミングをアプリが把握できるように、Android 16 では EXTENSION_NIGHT_MODE_INDICATOR
が追加されました。サポートされている場合は、Camera2 内の CaptureResult
で使用できます。
これは、Instagram でユーザーが美しい低照度写真を撮影できるようにした方法に関するブログ投稿で、近日提供予定として簡単に言及した API です。この投稿は、夜間モードを実装する方法に関する実用的なガイドです。また、アプリ内カメラで撮影された高画質の夜間モードの写真と、アプリ内カメラから共有される写真数の増加を結びつけるケーススタディも掲載されています。
モーション フォトのキャプチャ インテントのアクション
Android 16 添加了标准 intent 操作 ACTION_MOTION_PHOTO_CAPTURE
和 ACTION_MOTION_PHOTO_CAPTURE_SECURE
,用于请求相机应用拍摄动态照片并将其返回。
您必须传递额外的 EXTRA_OUTPUT
来控制将图片写入的位置,或者通过 Intent.setClipData(ClipData)
传递 Uri
。如果您未设置 ClipData
,系统会在调用 Context.startActivity(Intent)
时将其复制到该位置。
ウルトラ HDR 画像の補正
![](https://developer.android.google.cn/static/about/versions/16/images/SDR-HDR-compare.png?authuser=2&hl=ja)
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 adds RuntimeColorFilter
and
RuntimeXfermode
, allowing you to author complex effects like
Threshold, Sepia, and Hue Saturation and apply them to draw calls. Since Android
13, you've been able to use AGSL to create custom
RuntimeShaders that extend Shader
. The new API
mirrors this, adding an AGSL-powered RuntimeColorFilter
that
extends ColorFilter
, and a Xfermode
effect that
lets you implement AGSL-based custom compositing and blending between source and
destination pixels.
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 包含新的 RangingManager
,它提供了在受支持的硬件上确定本地设备与远程设备之间的距离和角度的方法。RangingManager
支持使用各种测距技术,例如 BLE 信道声音探测、基于 BLE RSSI 的测距、超宽带和 Wi-Fi 往返时间。
メディア
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 新增了 ACTIVITY_INTENSITY
,这是一种根据世界卫生组织关于中等强度和剧烈强度活动的指南定义的新数据类型。每个记录都需要提供开始时间、结束时间以及活动强度(中等或剧烈)。
Health Connect 还包含支持健康记录的更新版 API。这样一来,应用便可以在征得用户明确同意的情况下,以 FHIR 格式读取和写入医疗记录。此 API 目前处于抢先体验计划阶段。如果您想参与,请报名参加抢先体验计划。
Android 版プライバシー サンドボックス
Android 16 中集成了最新版本的 Privacy Sandbox on Android,这是我们持续致力于开发可让用户放心地知道其隐私受到保护的技术的一部分。您可以访问我们的网站,详细了解 Privacy Sandbox on Android 开发者 Beta 版计划,以便顺利上手。不妨了解 SDK 运行时,它可让 SDK 在与其所服务的应用分离的专用运行时环境中运行,从而为用户数据收集和共享提供更强的保护措施。
セキュリティ
Android 16 には、アプリのセキュリティを強化し、アプリのデータを保護する機能が含まれています。
Key sharing API
Android 16 では、Android Keystore キーへのアクセスを他のアプリと共有する API が追加されています。新しい KeyStoreManager
クラスは、アプリの uid による鍵へのアクセスの付与と取り消しをサポートし、アプリが共有鍵にアクセスするための API が含まれています。
デバイスのフォーム ファクタ
Android 16 では、Android のフォーム ファクタを最大限に活用できるアプリのサポートが提供されます。
テレビの画質と音質の標準化フレームワーク
Android 16 中的新 MediaQuality
软件包公开了一组标准化 API,用于访问音频和图片配置文件以及与硬件相关的设置。这样,在线播放应用就可以查询配置文件并将其动态应用于媒体:
- 使用更大动态范围进行母版制作的电影需要更高的色彩准确度,才能看清阴影中的细微细节并根据环境光线进行调整,因此,最好使用色彩准确度优先于亮度的配置文件。
- 体育赛事直播通常采用较窄的动态范围进行母版制作,但通常是在白天观看,因此偏向亮度而非色彩准确度的配置文件可以获得更好的效果。
- 完全交互式内容需要尽可能减少处理以缩短延迟时间,并且需要更高的帧速率,因此许多电视都附带游戏配置文件。
借助此 API,应用可以在个人资料之间切换,用户可以享受调整支持的电视,以便尽可能适合其内容。
多言語対応
Android 16 では、デバイスが異なる言語で使用されている場合のユーザー エクスペリエンスを補完する機能が追加されています。
縦向きのテキスト
Android 16 添加了对垂直渲染和测量文本的低级支持,以便为库开发者提供基本的垂直书写支持。这对于日语等通常使用竖向书写系统的语言特别有用。Paint
类中添加了一个新标志 VERTICAL_TEXT_FLAG
。使用 Paint.setFlags
设置此标志后,Paint 的文本测量 API 将报告垂直进度,而不是水平进度,并且 Canvas
将垂直绘制文本。
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」になります。
これらの設定を確認するには、設定アプリを開いて [システム] > [言語と地域] に移動します。