ฟีเจอร์และ API

Android 16 เปิดตัวฟีเจอร์และ API ใหม่ๆ ที่ยอดเยี่ยมสำหรับนักพัฒนาแอป ส่วนต่อไปนี้จะสรุปฟีเจอร์เหล่านี้เพื่อช่วยให้คุณเริ่มต้นใช้งาน API ที่เกี่ยวข้องได้

ดูรายการ API ใหม่ แก้ไข และนําออกอย่างละเอียดได้ที่รายงานความแตกต่างของ API ดูรายละเอียดเกี่ยวกับ API ใหม่ได้ที่เอกสารอ้างอิง Android API โดย API ใหม่จะได้รับการไฮไลต์ไว้ให้มองเห็น

นอกจากนี้ คุณควรตรวจสอบส่วนต่างๆ ที่การเปลี่ยนแปลงแพลตฟอร์มอาจส่งผลต่อแอปของคุณด้วย ดูข้อมูลเพิ่มเติมได้ที่หน้าต่อไปนี้

ฟังก์ชันหลัก

Android มี API ใหม่ที่ขยายความสามารถหลักของระบบ Android

Android API 2 รุ่นในปี 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.

ประสบการณ์ของผู้ใช้และ UI ของระบบ

Android 16 ช่วยให้นักพัฒนาแอปและผู้ใช้มีการควบคุมและความยืดหยุ่นมากขึ้นในการกำหนดค่าอุปกรณ์ให้เหมาะกับความต้องการ

การแจ้งเตือนที่เน้นความคืบหน้า

Android 16 引入了以进度为中心的通知,可帮助用户顺畅地跟踪用户发起的端到端历程。

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

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

锁屏上显示的以进度为中心的通知。
在通知栏中显示的以进度为中心的通知。

การอัปเดตการย้อนกลับที่คาดการณ์ได้

Android 16 添加了新 API,可帮助您在手势导航中启用预测性返回系统动画,例如“返回主屏幕”动画。通过使用新的 PRIORITY_SYSTEM_NAVIGATION_OBSERVER 注册 onBackInvokedCallback,您的应用可以在系统处理返回导航时接收常规的 onBackInvoked 调用,而不会影响正常的返回导航流程。

Android 16 还添加了 finishAndRemoveTaskCallback()moveTaskToBackCallback。通过向 OnBackInvokedDispatcher 注册这些回调,系统可以在调用返回手势时触发特定行为并播放相应的提前动画。

การโต้ตอบการสัมผัสที่ละเอียดยิ่งขึ้น

Android ได้เปิดการควบคุมตัวกระตุ้นการสัมผัสมาตั้งแต่เริ่มแรก

Android 11 เพิ่มการรองรับเอฟเฟกต์การสัมผัสที่ซับซ้อนมากขึ้นซึ่งตัวกระตุ้นขั้นสูงรองรับได้ผ่าน VibrationEffect.Compositions ของพรอมต์เชิงความหมายที่อุปกรณ์กำหนด

Android 16 เพิ่ม Haptic API ที่ช่วยแอปกำหนดความกว้างและความถี่ของเส้นโค้งของผลลัพธ์การสัมผัสได้ขณะที่แยกความแตกต่างระหว่างความสามารถของอุปกรณ์

เครื่องมือและประสิทธิภาพการทำงานของนักพัฒนาซอฟต์แวร์

แม้ว่างานส่วนใหญ่ของเราเพื่อปรับปรุงประสิทธิภาพการทำงานจะมุ่งเน้นไปที่เครื่องมือต่างๆ เช่น Android Studio, Jetpack Compose และไลบรารี Android Jetpack แต่เราก็มองหาวิธีต่างๆ ในแพลตฟอร์มเพื่อช่วยให้คุณสามารถบรรลุเป้าหมายได้เสมอ

การจัดการเนื้อหาสำหรับวอลเปเปอร์เคลื่อนไหว

在 Android 16 中,动态壁纸框架将获得一个新的 content API,以应对由用户驱动的动态壁纸带来的挑战。目前,包含用户提供的内容的实时壁纸需要复杂的服务专用实现。Android 16 引入了 WallpaperDescriptionWallpaperInstance。借助 WallpaperDescription,您可以识别同一服务中的动态壁纸的不同实例。例如,如果某张壁纸同时在主屏幕和锁定屏幕上显示,则这两种情况下显示的内容可能各不相同。壁纸选择器和 WallpaperManager 会使用此元数据更好地向用户呈现壁纸,从而简化创建多样化个性化动态壁纸体验的过程。

ประสิทธิภาพและแบตเตอรี่

Android 16 เปิดตัว API ที่ช่วยรวบรวมข้อมูลเชิงลึกเกี่ยวกับแอป

โปรไฟล์ที่ระบบทริกเกอร์

ProfilingManager 在 Android 15 中添加,让应用能够在现场使用 Perfetto 请求收集性能数据。不过,由于此性能分析必须从应用启动,因此应用很难或根本无法捕获启动或 ANR 等关键流程。

为此,Android 16 向 ProfilingManager 引入了系统触发的性能分析。应用可以注册接收特定触发器(例如冷启动 reportFullyDrawn 或 ANR)轨迹的兴趣,然后系统会代表应用启动和停止轨迹。轨迹完成后,结果会传送到应用的数据目录。

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

Headroom API ใน ADPF

SystemHealthManager 引入了 getCpuHeadroomgetGpuHeadroom API,旨在为游戏和资源密集型应用提供可用 CPU 和 GPU 资源的估算值。通过这些方法,您可以评估应用或游戏如何以最佳方式改善系统运行状况,尤其是在与用于检测热节流的其他 Android 动态性能框架 (ADPF) API 搭配使用时。

在受支持的设备上使用 CpuHeadroomParamsGpuHeadroomParams,您可以自定义用于计算余量的时间范围,并在平均资源可用性或最低资源可用性之间进行选择。这有助于您相应地减少 CPU 或 GPU 资源用量,从而提升用户体验并延长电池续航时间。

การช่วยเหลือพิเศษ

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 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 adds camera support for fine color temperature and tint adjustments to better support professional video recording applications. In previous Android versions, you could control white balance settings through CONTROL_AWB_MODE, which contains options limited to a preset list, such as Incandescent, Cloudy, and Twilight. The COLOR_CORRECTION_MODE_CCT enables the use of COLOR_CORRECTION_COLOR_TEMPERATURE and COLOR_CORRECTION_COLOR_TINT for precise adjustments of white balance based on the correlated color temperature.

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

The following examples show how a photo would look after applying different color temperature and tint adjustments:

The original image with no color temperature or tint adjustments applied.
The image with color temperature adjusted to 3000.
The image with color temperature adjusted to 7000.


The image with tint levels lowered by 50.
The image with tint levels raised by 50.

การตรวจจับฉากในโหมดกลางคืนของกล้อง

为了帮助应用了解何时切换到夜间模式相机会话以及何时从夜间模式相机会话切换出,Android 16 添加了 EXTENSION_NIGHT_MODE_INDICATOR。如果受支持,则可在 Camera2 内的 CaptureResult 中使用。

这是我们在Instagram 如何让用户拍出令人惊艳的低光照片博文中提到的即将推出的 API。该博文提供了有关如何实现夜间模式的实用指南,并附有一份案例研究,该案例研究将应用内夜间模式照片质量的提升与通过应用内相机分享的照片数量的增加联系起来。

การดำเนินการผ่าน Intent สำหรับการจับภาพเคลื่อนไหว

Android 16 添加了标准 intent 操作 ACTION_MOTION_PHOTO_CAPTUREACTION_MOTION_PHOTO_CAPTURE_SECURE,用于请求相机应用拍摄动态照片并将其返回。

您必须传递额外的 EXTRA_OUTPUT 来控制将图片写入的位置,或者通过 Intent.setClipData(ClipData) 传递 Uri。如果您未设置 ClipData,系统会在调用 Context.startActivity(Intent) 时将其复制到该位置。

动态照片示例,显示静态图片和动态播放画面。

การปรับปรุงรูปภาพด้วย UltraHDR

标准动态范围 (SDR) 与高动态范围 (HDR) 图片质量对比示意图。

Android 16 继续致力于通过 UltraHDR 图片提供出色的图片质量。它添加了对 HEIC 文件格式的 UltraHDR 图片的支持。这些图片将获得 ImageFormat 类型 HEIC_ULTRAHDR,并包含类似于现有 UltraHDR JPEG 格式的嵌入式增益图。我们还在努力为 UltraHDR 添加 AVIF 支持,敬请期待。

此外,Android 16 在 UltraHDR 中实现了 ISO 21496-1 草稿标准中的其他参数,包括能够获取和设置应应用增益图算法的色彩空间,以及支持使用 SDR 增益图的 HDR 编码基础图片。

กราฟิก

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

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 มีฟีเจอร์มากมายที่ช่วยปรับปรุงประสบการณ์การใช้งานสื่อ

การปรับปรุงเครื่องมือเลือกรูปภาพ

照片选择器为用户提供了一种安全的内置授权方式,让用户可以向应用授予对本地存储空间和云端存储空间中所选图片和视频的访问权限,而不是对整个媒体库的访问权限。通过 Google 系统更新Google Play 服务组合使用模块化系统组件,该工具向后支持到 Android 4.4(API 级别 19)。只需几行代码即可与相关的 Android Jetpack 库集成。

Android 16 对照片选择器进行了以下改进:

  • 嵌入式照片选择器新 API,可让应用将照片选择器嵌入其视图层次结构中。这样,它就感觉像是应用中更为集成的一部分,同时仍可利用进程隔离功能,让用户能够选择媒体,而无需应用拥有过于宽泛的权限。为了最大限度地提高跨平台版本的兼容性并简化集成,如果您想集成嵌入式照片选择器,则需要使用即将推出的 Android Jetpack 库。
  • 照片选择器中的云搜索新的 API 可让 Android 照片选择器从云端媒体提供商中进行搜索。照片选择器中的搜索功能即将推出。

วิดีโอขั้นสูงระดับมืออาชีพ

Android 16 引入了对高级专业视频 (APV) 编解码器的支持,该编解码器专为专业级高品质视频录制和后期制作而设计。

APV 编解码器标准具有以下特点:

  • 感知上无损的视频画质(接近原始视频画质)
  • 复杂度低且吞吐量高的仅帧内编码(无像素域预测),以更好地支持编辑工作流
  • 支持高比特率范围(最高几十 Gbps),适用于 2K、4K 和 8K 分辨率内容,由轻量级熵编码方案实现
  • 帧平铺,用于沉浸式内容和启用并行编码和解码
  • 支持各种色度采样格式和位深
  • 支持多次解码和重新编码,且不会严重降低视觉质量
  • 支持多视图视频和辅助视频,例如深度、Alpha 和预览
  • 支持 HDR10/10+ 和用户定义的元数据

OpenAPV 项目提供了 APV 的参考实现。Android 16 将实现对 APV 422-10 配置文件的支持,该配置文件提供 YUV 422 色彩采样以及 10 位编码,并且目标比特率最高可达 2 Gbps。

ความเป็นส่วนตัว

Android 16 มีฟีเจอร์มากมายที่ช่วยให้นักพัฒนาแอปปกป้องความเป็นส่วนตัวของผู้ใช้

การอัปเดต Health Connect

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 ใน Android

Android 16 มี Privacy Sandbox ใน Android เวอร์ชันล่าสุด ซึ่งเป็นส่วนหนึ่งของความพยายามอย่างต่อเนื่องของเราในการพัฒนาเทคโนโลยีที่ผู้ใช้รู้ว่าความเป็นส่วนตัวของตนได้รับการคุ้มครอง เว็บไซต์ของเรามีข้อมูลเพิ่มเติมเกี่ยวกับโปรแกรมเบต้าสำหรับนักพัฒนาแอป Android ของ Privacy Sandbox เพื่อช่วยให้คุณเริ่มต้นใช้งาน โปรดดูรันไทม์ของ SDK ซึ่งช่วยให้ SDK ทำงานในสภาพแวดล้อมรันไทม์เฉพาะที่แยกจากแอปที่ให้บริการ ซึ่งช่วยเสริมเกราะป้องกันที่มากขึ้นในการเก็บรวบรวมและแชร์ข้อมูลผู้ใช้

ความปลอดภัย

Android 16 มีฟีเจอร์ที่ช่วยเพิ่มความปลอดภัยของแอปและปกป้องข้อมูลของแอป

Key Sharing API

Android 16 เพิ่ม API ที่รองรับการแชร์สิทธิ์เข้าถึงคีย์ใน Android Keystore กับแอปอื่นๆ คลาส KeyStoreManager ใหม่รองรับการให้และเพิกถอนสิทธิ์เข้าถึงคีย์ตาม uid ของแอป และมี API สําหรับแอปในการเข้าถึงคีย์ที่แชร์

รูปแบบของอุปกรณ์

Android 16 รองรับแอปของคุณเพื่อให้ได้รับประโยชน์สูงสุดจากรูปแบบของ Android

กรอบคุณภาพของภาพและเสียงที่เป็นมาตรฐานสำหรับทีวี

MediaQualityแพ็กเกจใหม่ใน Android 16 จะแสดงชุด 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”。

如需找到这些设置,请打开“设置”应用,然后依次前往系统 > 语言和地区