תכונות וממשקי API

ב-Android 16 יש תכונות חדשות וממשקי API חדשים ושימושיים למפתחים. בקטעים הבאים מופיע סיכום של התכונות האלה שיעזור לכם להתחיל להשתמש בממשקי ה-API שקשורים אליהן.

רשימה מפורטת של ממשקי API חדשים, ממשקי API שעברו שינוי וממשקי API שהוסרו מופיעה בדוח ההבדלים בין גרסאות API. פרטים על ממשקי API חדשים זמינים בהפניית Android API. ממשקי API חדשים מסומנים כדי שיהיה קל לראות אותם.

כדאי גם לבדוק תחומים שבהם שינויים בפלטפורמה עשויים להשפיע על האפליקציות שלכם. למידע נוסף, ראו את הדפים הבאים:

פונקציונליות עיקרית

‫Android כוללת ממשקי API חדשים שמרחיבים את יכולות הליבה של מערכת Android.

שתי גרסאות של Android API בשנת 2025

  • 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.

Timeline view of Android releases in 2025, noting that the 25Q2
       release is a major release and the 25Q4 release is a minor release.

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 引入了以进度为中心的通知,可帮助用户顺畅地跟踪用户发起的端到端历程。

Notification.ProgressStyle 是一种新的通知样式,可让您创建以进度为中心的通知。主要用例包括共享车辆、送货和导航。在 Notification.ProgressStyle 类中,您可以使用细分来表示用户体验历程中的状态和里程碑。

To learn more, see the Progress-centric notifications documentation page.

התראה שמתמקדת בהתקדמות מוצגת במסך הנעילה.
התראה שמתמקדת בהתקדמות מוצגת בחלונית ההתראות.

עדכונים של חיזוי החזרה

ב-Android 16 נוספו ממשקי API חדשים שיעזרו לכם להפעיל אנימציות מערכת חזרה חזויות בניווט באמצעות תנועות, כמו אנימציה של חזרה לדף הבית. רישום ה-onBackInvokedCallback באמצעות PRIORITY_SYSTEM_NAVIGATION_OBSERVER החדש מאפשר לאפליקציה לקבל את הקריאה הרגילה onBackInvoked בכל פעם שהמערכת מטפלת בניווט לאחור, בלי להשפיע על תהליך הניווט לאחור הרגיל.

ב-Android 16 נוספו גם הסמלים finishAndRemoveTaskCallback() ו-moveTaskToBackCallback. כשרושמים את הפונקציות האלה באמצעות OnBackInvokedDispatcher, המערכת יכולה להפעיל התנהגויות ספציפיות ולהפעיל אנימציות מתאימות מראש כשמפעילים את תנועת החזרה.

משוב פיזי עשיר יותר

自诞生之日起,Android 就提供了对触感反馈致动器的控制。

Android 11 添加了对更复杂的触感反馈效果的支持,更高级的致动器可以通过设备定义的语义基元 VibrationEffect.Compositions 支持这些效果。

Android 16 添加了触感反馈 API,让应用能够定义触感反馈效果的振幅和频率曲线,同时抽象出设备功能之间的差异。

פרודוקטיביות וכלים למפתחים

רוב העבודה שלנו לשיפור הפרודוקטיביות מתמקדת בכלים כמו Android Studio,‏ Jetpack Compose וספריות Android Jetpack, אבל אנחנו תמיד מחפשים דרכים לעזור לכם להגשים את החזון שלכם בפלטפורמה.

טיפול בתוכן של טפטים דינמיים

In Android 16, the live wallpaper framework is gaining a new content API to address the challenges of dynamic, user-driven wallpapers. Currently, live wallpapers incorporating user-provided content require complex, service-specific implementations. Android 16 introduces WallpaperDescription and WallpaperInstance. WallpaperDescription lets you identify distinct instances of a live wallpaper from the same service. For example, a wallpaper that has instances on both the home screen and on the lock screen may have unique content in both places. The wallpaper picker and WallpaperManager use this metadata to better present wallpapers to users, streamlining the process for you to create diverse and personalized live wallpaper experiences.

ביצועים וסוללה

‫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 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.

בדיקה טובה יותר של המשרה

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,我们将继续努力,将 ARR 支持添加到更多 Jetpack 库中。这篇帧速率文章介绍了许多可用于设置帧速率的 API,以便您的应用可以直接使用 ARR。

ממשקי Headroom API ב-ADPF

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 类的自定义文本渲染,则可以使用此方法来了解何时启用轮廓文本。

Android 16 推出新的轮廓文本无障碍功能前后,对比度更高的文本

向 TtsSpan 添加了时长

Android 16 使用 TYPE_DURATION 扩展了 TtsSpan,其中包含 ARG_HOURSARG_MINUTESARG_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 getCheckedsetChecked(int) 方法现在除了“已选中”和“未选中”之外,还支持“部分选中”状态。此字段取代了已废弃的布尔值 isCheckedsetChecked(boolean)

补充说明

如果无障碍服务提供关于 ViewGroup 的说明,则会将来自其子视图的内容标签合并在一起。如果您为 ViewGroup 提供 contentDescription,无障碍服务会假定您还要覆盖不可聚焦的子视图的说明。如果您想为下拉菜单等内容添加标签(例如“字体系列”),同时保留当前的无障碍功能选择(例如“Roboto”),这可能会造成问题。Android 16 添加了 setSupplementalDescription,以便您提供用于提供 ViewGroup 相关信息的文本,而不会覆盖其子项中的信息。

必填表单字段

Android 16 向 AccessibilityNodeInfo 添加了 setFieldRequired,以便应用可以告知无障碍服务需要输入表单字段。对于填写各种类型表单的用户而言,这是一个重要的场景,即使是简单的必填条款及条件复选框,也能帮助用户始终如一地识别必填字段并在必填字段之间快速导航。

הטלפון כקלט מיקרופון לשיחות קוליות עם מכשירי שמיעה בתקן 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.

שליטה בעוצמת הקולות מהסביבה במכשירי שמיעה עם LEA

Android 16 adds the capability for users of LE Audio hearing aids to adjust the volume of ambient sound that is picked up by the hearing aid's microphones. This can be helpful in situations where background noise is too loud or too quiet.

מצלמה

ב-Android 16 יש תמיכה משופרת במשתמשים במצלמות מקצועיות, עם אפשרות לחשיפה אוטומטית היברידית ושינויים מדויקים בטמפרטורת הצבע ובגוון. מחוון חדש של מצב לילה עוזר לאפליקציה לדעת מתי לעבור למצב לילה ומתי לצאת ממנו במהלך צילום במצלמה. Intentפעולות חדשות מקלות על צילום תמונות עם תנועה, ואנחנו ממשיכים לשפר את תמונות ה-UltraHDR עם תמיכה בקידוד HEIC ופרמטרים חדשים מטיוטת התקן ISO 21496-1.

חשיפה אוטומטית היברידית

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_TEMPERATURECOLOR_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) ...
}

以下示例展示了应用不同色温和色调调整后的照片效果:

未应用色温或色调调整的原始图片。
将色温调整为 3000 的图片。
将色温调整为 7000 的图片。


将色调级别降低 50 的图片。
色调级别提高了 50 的图片。

זיהוי סצנות במצב לילה במצלמה

כדי לעזור לאפליקציה לדעת מתי לעבור לסשן צילום במצב לילה ומתי לצאת ממנו, נוסף ל-Android 16 EXTENSION_NIGHT_MODE_INDICATOR. אם התכונה נתמכת, היא תהיה זמינה בCaptureResult בתוך Camera2.

זהו ממשק ה-API שציינו בקצרה כשיגיע בקרוב בפוסט בבלוג איך Instagram אפשרה למשתמשים לצלם תמונות מדהימות בתאורה נמוכה. הפוסט הזה כולל מדריך מעשי להטמעת מצב לילה, יחד עם מחקר מקרה שמקשר בין תמונות באיכות גבוהה יותר שצולמו במצב לילה באפליקציה לבין עלייה במספר התמונות ששותפו מהמצלמה שבאפליקציה.

פעולות 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).

An example of a motion photo, showing the still image followed by the motion playback.

שיפורים בתמונות UltraHDR

An illustration of Standard Dynamic Range (SDR) versus High Dynamic Range (HDR) image quality.

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 添加了 RuntimeColorFilterRuntimeXfermode,让您可以创作阈值、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 标准集成,可利用其基础架构和功能实现更广泛的采用和更轻松的部署。

Generic ranging APIs

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.

נוכחות של מכשיר נלווה

In Android 16, new APIs are being introduced for binding your companion app service. Service will be bound when BLE is in range and Bluetooth is connected and service will be unbound when BLE is out of range or Bluetooth is disconnected. App will receives a new 'onDevicePresenceEvent()' callback based on various of DevicePresenceEvent. More details can be found in 'startObservingDevicePresence(ObservingDevicePresenceRequest)'.

מדיה

‫Android 16 כולל מגוון תכונות שמשפרות את חוויית המדיה.

שיפורים בכלי לבחירת תמונות

הכלי לבחירת תמונות מספק למשתמשים דרך מובנית ובטוחה להעניק לאפליקציה גישה לתמונות ולסרטונים שנבחרו, גם מהאחסון המקומי וגם מהענן, במקום לגישה לכל ספריית המדיה שלהם. באמצעות שילוב של רכיבי מערכת מודולריים דרך Google System Updates ו-Google Play Services, התכונה נתמכת כבר מ-Android 4.4 (רמת API‏ 19). לשילוב נדרשות רק כמה שורות קוד עם ספריית Android Jetpack המשויכת.

ב-Android 16 נוספו לשולחן הבחירה של התמונות השיפורים הבאים:

  • בורר תמונות מוטמע: ממשקי API חדשים שמאפשרים לאפליקציות להטמיע את הבורר בתוך היררכיית התצוגה שלהן. כך הוא מרגיש כמו חלק משולב יותר באפליקציה, ועדיין מנצל את בידוד התהליכים שמאפשר למשתמשים לבחור מדיה בלי שהאפליקציה תצטרך הרשאות רחבות מדי. כדי למקסם את התאימות לגרסאות השונות של הפלטפורמה ולפשט את השילוב, אם אתם רוצים לשלב את הכלי המוטמע לבחירת תמונות, כדאי להשתמש בספרייה העתידית של Android Jetpack.
  • חיפוש בענן בבורר התמונות: ממשקי API חדשים שמאפשרים חיפוש מספק המדיה בענן בבורר התמונות של Android. בקרוב נוסיף פונקציית חיפוש לבורר התמונות.

סרטונים מקצועיים מתקדמים

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

Health Connect 添加了 ACTIVITY_INTENSITY,这是一种根据世界卫生组织关于中等强度和剧烈强度活动的指南定义的数据类型。每个记录都需要提供开始时间、结束时间以及活动强度(中等或剧烈)。

Health Connect 还包含支持医疗记录的更新版 API。这样一来,应用便可在征得用户明确同意的情况下,读取和写入 FHIR 格式的医疗记录。

ארגז החול לפרטיות ב-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 כולל תכונות שעוזרות לשפר את האבטחה של האפליקציה ולהגן על הנתונים שלה.

Key sharing API

Android 16 添加了一些 API,这些 API 支持与其他应用共享对 Android Keystore 密钥的访问权限。新的 KeyStoreManager 类支持按应用 uid 授予撤消对密钥的访问权限,并包含一个供应用访问共享密钥的 API。

גורמי צורה של מכשירים

‫Android 16 מספק לאפליקציות שלכם תמיכה כדי להפיק את המרב מגורמי הצורה של Android.

מסגרת תקנים לאיכות התמונה והאודיו בטלוויזיות

The new MediaQuality package in Android 16 exposes a set of standardized APIs for access to audio and picture profiles and hardware-related settings. This allows streaming apps to query profiles and apply them to media dynamically:

  • Movies mastered with a wider dynamic range require greater color accuracy to see subtle details in shadows and adjust to ambient light, so a profile that prefers color accuracy over brightness may be appropriate.
  • Live sporting events are often mastered with a narrow dynamic range, but are often watched in daylight, so a profile that preferences brightness over color accuracy can give better results.
  • Fully interactive content wants minimal processing to reduce latency, and wants higher frame rates, which is why many TV's ship with a game profile.

The API allows apps to switch between profiles and users to enjoy tuning supported TVs to best suit their content.

אינטרנציונליזציה

ב-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
            )
        }
    }
) {}

התאמה אישית של שיטת המדידה

Users can now customize their measurement system in regional preferences within Settings. The user preference is included as part of the locale code, so you can register a BroadcastReceiver on ACTION_LOCALE_CHANGED to handle locale configuration changes when regional preferences change.

Using formatters can help match the local experience. For example, "0.5 in" in English (United States), is "12,7 mm" for a user who has set their phone to English (Denmark) or who uses their phone in English (United States) with the metric system as the measurement system preference.

To find these settings, open the Settings app and navigate to System > Languages & region.