Funzionalità e API

Android 16 introduce nuove fantastiche funzionalità e API per gli sviluppatori. Le sezioni seguenti riepilogano queste funzionalità per aiutarti a iniziare a utilizzare le API correlate.

Per un elenco dettagliato delle API nuove, modificate e rimosse, leggi il report diff API. Per informazioni dettagliate sulle nuove API, visita la documentazione di riferimento delle API Android. Le nuove API sono evidenziate per una maggiore visibilità.

Devi anche esaminare le aree in cui le modifiche alla piattaforma potrebbero influire sulle tue app. Per maggiori informazioni, consulta le seguenti pagine:

Funzionalità di base

Android include nuove API che espandono le funzionalità di base del sistema Android.

Due release dell'API Android nel 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.

Esperienza utente e UI di sistema

Android 16 offre a sviluppatori di app e utenti maggiore controllo e flessibilità per configurare il dispositivo in base alle proprie esigenze.

Notifiche incentrate sui progressi

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

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

Per scoprire di più, consulta la pagina di documentazione relativa alle notifiche incentrate sul progresso.

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

Aggiornamenti di Indietro predittivo

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.

Feedback aptico più ricco

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.

Produttività e strumenti per gli sviluppatori

La maggior parte del nostro lavoro per migliorare la tua produttività si concentra su strumenti come Android Studio, Jetpack Compose e le librerie Android Jetpack, ma cerchiamo sempre modi nella piattaforma per aiutarti a realizzare la tua visione.

Gestione dei contenuti per gli sfondi animati

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.

Prestazioni e batteria

Android 16 introduce API che aiutano a raccogliere informazioni sulle tue app.

Profilazione attivata dal sistema

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

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

Avvia componente in ApplicationStartInfo

ApplicationStartInfo 在 Android 15 中添加,可让应用查看进程启动原因、启动类型、启动时间、节流和其他实用诊断数据。Android 16 添加了 getStartComponent(),用于区分触发启动的组件类型,这有助于优化应用的启动流程。

Migliore introspezione dei job

L'API JobScheduler#getPendingJobReason() restituisce il motivo per cui un job potrebbe essere in attesa. Tuttavia, un job potrebbe essere in attesa per più motivi.

In Android 16, stiamo introducendo una nuova API JobScheduler#getPendingJobReasons(int jobId), che restituisce più motivi per cui un job è in attesa, sia a causa di vincoli espliciti impostati dall' sviluppatore sia di vincoli impliciti impostati dal sistema.

Stiamo anche introducendo JobScheduler#getPendingJobReasonsHistory(int jobId), che restituisce un elenco delle modifiche ai vincoli più recenti.

Ti consigliamo di utilizzare l'API per aiutarti a eseguire il debug del motivo per cui i job potrebbero non essere eseguiti, soprattutto se riscontri tassi di successo ridotti di determinate attività o hai bug relativi alla latenza del completamento di determinati job. Ad esempio, l'aggiornamento dei widget in background non è andato a buon fine o non è stato possibile chiamare il job di pre-caricamento prima dell'avvio dell'app.

In questo modo puoi anche capire meglio se determinati job non vengono completati a causa di vincoli definiti dal sistema rispetto a vincoli impostati esplicitamente.

Frequenza di aggiornamento adattiva

Android 15 中引入的自适应刷新率 (ARR) 可让受支持硬件上的显示屏刷新率使用离散的 VSync 步长来适应内容帧速率。这不仅降低了功耗,还无需进行可能导致卡顿的模式切换。

Android 16 引入了 hasArrSupport()getSuggestedFrameRate(int),同时恢复了 getSupportedRefreshRates(),以便您的应用更轻松地利用 ARR。RecyclerView 1.4从快速滑动或平滑滚动中稳定下来时会在内部支持 ARR,我们将继续努力,将 ARR 支持添加到更多 Jetpack 库中。这篇帧速率文章介绍了许多可用于设置帧速率的 API,以便您的应用可以直接使用 ARR。

API Headroom in 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.

Accessibilità

Android 16 aggiunge nuove API e funzionalità di accessibilità che possono aiutarti a rendere la tua app disponibile per tutti gli utenti.

API di accessibilità migliorate

Android 16 aggiunge API aggiuntive per migliorare la semantica dell'interfaccia utente, contribuendo a migliorare la coerenza per gli utenti che si affidano a servizi di accessibilità, come TalkBack.

Testo con contorni per il massimo contrasto del testo

Gli utenti ipovedenti hanno spesso una sensibilità al contrasto ridotta, il che rende difficile distinguere gli oggetti dallo sfondo. Per aiutare questi utenti, Android 16 introduce il testo con contorni, che sostituisce il testo ad alto contrasto e disegna un'area di contrasto più grande intorno al testo per migliorarne notevolmente la leggibilità.

Android 16 contiene nuove API AccessibilityManager che consentono alle tue app di controllare o registrare un ascoltatore per verificare se questa modalità è attivata. Questo è principalmente per i kit di strumenti per l'interfaccia utente come Compose per offrire un'esperienza visiva simile. Se gestisci una libreria UI Toolkit o la tua app esegue il rendering di testo personalizzato che aggira la classe android.text.Layout, puoi utilizzarla per sapere quando è attivato il testo con contorni.

Testo con contrasto migliorato prima e dopo la nuova funzionalità di accessibilità del testo in rilievo di Android 16

Durata aggiunta a TtsSpan

Android 16 estende TtsSpan con un TYPE_DURATION, costituito da ARG_HOURS, ARG_MINUTES e ARG_SECONDS. In questo modo puoi annotare direttamente la durata del tempo, garantendo un output di sintesi vocale accurato e coerente con servizi come TalkBack.

Supportare elementi con più etichette

Al momento Android consente agli elementi dell'interfaccia utente di ricavare l'etichetta di accessibilità da un'altra e ora offre la possibilità di associare più etichette, uno scenario comune nei contenuti web. Con l'introduzione di un'API basata su elenchi in AccessibilityNodeInfo, Android può supportare direttamente queste relazioni con più etichette. Nell'ambito di questa modifica, abbiamo ritirato AccessibilityNodeInfo#setLabeledBy e #getLabeledBy in favore di #addLabeledBy, #removeLabeledBy e #getLabeledByList.

Supporto migliorato per gli elementi espandibili

Android 16 aggiunge API di accessibilità che consentono di trasmettere lo stato espanso o chiuso degli elementi interattivi, come menu ed elenchi espandibili. Impostando lo stato espanso utilizzando setExpandedState e inviando eventi di accessibilità TYPE_WINDOW_CONTENT_CHANGED con un tipo di modifica dei contenuti CONTENT_CHANGE_TYPE_EXPANDED, puoi assicurarti che gli screen reader come TalkBack annuncino le modifiche dello stato, offrendo un'esperienza utente più intuitiva e inclusiva.

Barre di avanzamento indeterminate

Android 16 aggiunge RANGE_TYPE_INDETERMINATE, che ti consente di esporre RangeInfo sia per i widget ProgressBar determinati che per quelli indeterminati, consentendo a servizi come TalkBack di fornire feedback più coerenti per gli indicatori di avanzamento.

Casella di controllo tri-stato

I nuovi metodi AccessibilityNodeInfo getChecked e setChecked(int) in Android 16 ora supportano uno stato "parzialmente selezionato", oltre a "selezionato" e "deselezionato". Questo sostituisce i valori booleani isChecked e setChecked(boolean) deprecati.

Descrizioni supplementari

Quando un servizio di accessibilità descrive un elemento ViewGroup, combina le etichette dei contenuti delle relative visualizzazioni secondarie. Se fornisci un valore contentDescription per ViewGroup, i servizi di accessibilità presumono che tu stia anche eseguendo l'override della descrizione delle visualizzazioni secondarie non attivabili. Questo può essere problematico se vuoi etichettare elementi come un menu a discesa (ad esempio "Famiglia di caratteri") mantenendo al contempo la selezione corrente per l'accessibilità (ad esempio "Roboto"). Android 16 aggiunge setSupplementalDescription in modo da poter fornire testo che fornisca informazioni su un ViewGroup senza sostituire le informazioni dei relativi elementi secondari.

Campi obbligatori del modulo

Android 16 aggiunge setFieldRequired a AccessibilityNodeInfo in modo che le app possano comunicare a un servizio di accessibilità che l'input in un campo del modulo è obbligatorio. Si tratta di uno scenario importante per gli utenti che compilano molti tipi di moduli, anche elementi semplici come una casella di controllo obbligatoria per i termini e le condizioni, che aiutano gli utenti a identificare in modo coerente e a spostarsi rapidamente tra i campi obbligatori.

Smartphone come input del microfono per le chiamate vocali con apparecchi acustici 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.

Controlli del volume ambientale per apparecchi acustici LEA

Android 16 新增了一项功能,可让 LE Audio 助听器用户调节助听器麦克风接收的环境声音的音量。在背景噪音过大或过小的情况下,这可能会很有用。

Fotocamera

Android 16 migliora il supporto per gli utenti di fotocamere professionali, consentendo l'esposizione automatica ibrida insieme a regolazioni precise di tinta e temperatura di colore. Un nuovo indicatore della modalità notturna aiuta l'app a sapere quando passare a una sessione della fotocamera in modalità notturna e viceversa. Le nuove azioni Intent semplificano l'acquisizione di foto in movimento e continuiamo a migliorare le immagini Ultra HDR con il supporto della codifica HEIC e di nuovi parametri dello standard ISO 21496-1.

Esposizione automatica ibrida

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

Regolazioni precise di tinta e temperatura di colore

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 的图片。

Rilevamento della scena in modalità notturna della fotocamera

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

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

Azioni intent di acquisizione di foto in movimento

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

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

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

Miglioramenti delle immagini 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.

Grafica

Android 16 include i più recenti miglioramenti grafici, come gli effetti grafici personalizzati con AGSL.

Effetti grafici personalizzati con AGSL

Android 16 aggiunge RuntimeColorFilter e RuntimeXfermode, che ti consentono di creare effetti complessi come Soglia, Seppia e Saturazione tonalità e applicarli alle chiamate di disegno. Da Android 13, puoi utilizzare AGSL per creare personalizzati RuntimeShaders che estendono Shader. La nuova API riflette questo approccio, aggiungendo un RuntimeColorFilter basato su AGSL che estende ColorFilter e un effetto Xfermode che consente di implementare il compositing e l'unione personalizzati basati su AGSL tra i pixel di origine e di destinazione.

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
}

Connettività

Android 16 aggiorna la piattaforma per consentire alla tua app di accedere agli ultimi progressi nelle tecnologie di comunicazione e wireless.

Rilevamento con sicurezza avanzata

Android 16 在搭载 Wi-Fi 6 的 802.11az 的受支持设备上为 Wi-Fi 位置信息添加了对强大的安全功能的支持,让应用能够将该协议的更高精确性、更高可伸缩性和动态调度与安全增强功能(包括基于 AES-256 的加密和防范中间人攻击)相结合。这样,在近距离使用情形(例如解锁笔记本电脑或车门)时,便可更安全地使用该功能。802.11az 与 Wi-Fi 6 标准集成,可利用其基础架构和功能实现更广泛的采用和更轻松的部署。

API di misurazione generiche

Android 16 include il nuovo RangingManager, che fornisce modi per determinare la distanza e l'angolo sull'hardware supportato tra il dispositivo locale e un dispositivo remoto. RangingManager supporta l'utilizzo di varie tecnologie di misurazione della distanza, come la rilevazione del canale BLE, la misurazione della distanza basata su RSSI BLE, la banda ultralarga e il tempo di viaggio di andata e ritorno del Wi-Fi.

Presenza del dispositivo Gestione dispositivi companion

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

Media

Android 16 include una serie di funzionalità che migliorano l'esperienza multimediale.

Miglioramenti al selettore di foto

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

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

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

Video professionale avanzato

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.

Privacy

Android 16 include una serie di funzionalità che aiutano gli sviluppatori di app a proteggere la privacy degli utenti.

Aggiornamenti di Connessione Salute

Connessione Salute aggiunge ACTIVITY_INTENSITY, un tipo di dato definito in base alle linee guida dell'Organizzazione Mondiale della Sanità per le attività moderate e intense. Ogni record richiede l'ora di inizio, l'ora di fine e se l'intensità dell'attività è moderata o intensa.

Connessione Salute contiene anche API aggiornate che supportano le cartelle cliniche. In questo modo le app possono leggere e scrivere documenti medici in formato FHIR con il consenso esplicito dell'utente.

Privacy Sandbox su Android

Android 16 中集成了最新版本的 Privacy Sandbox on Android,这是我们持续致力于开发可让用户放心地知道其隐私受到保护的技术的一部分。您可以访问我们的网站,详细了解 Privacy Sandbox on Android 开发者 Beta 版计划,以便顺利上手。不妨了解 SDK 运行时,它可让 SDK 在与其所服务的应用分离的专用运行时环境中运行,从而为用户数据收集和共享提供更强的保护措施。

Sicurezza

Android 16 include funzionalità che ti aiutano a migliorare la sicurezza della tua app e a proteggere i dati dell'app.

API per la condivisione delle chiavi

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

Fattori di forma dei dispositivi

Android 16 offre alle tue app il supporto per sfruttare al meglio i fattori di forma di Android.

Framework standardizzato per la qualità audio e video delle TV

Il nuovo MediaQuality package in Android 16 espone un insieme di API standardizzate per l'accesso ai profili audio e di immagini e alle impostazioni relative all'hardware. In questo modo, le app di streaming possono eseguire query sui profili e applicarli ai contenuti multimediali in modo dinamico:

  • I film masterizzati con una gamma dinamica più ampia richiedono una maggiore accuratezza del colore per vedere dettagli sottili nelle ombre e adattarsi alla luce ambientale, pertanto potrebbe essere appropriato un profilo che preferisca l'accuratezza del colore alla luminosità.
  • Gli eventi sportivi dal vivo vengono spesso masterizzati con una gamma dinamica ristretta, ma spesso vengono guardati alla luce del giorno, quindi un profilo che preferisce la luminosità all'accuratezza del colore può dare risultati migliori.
  • I contenuti completamente interattivi richiedono un'elaborazione minima per ridurre la latenza e una frequenza frame più elevata, motivo per cui molte TV sono dotate di un profilo di gioco.

L'API consente alle app di passare da un profilo all'altro e agli utenti di regolare le TV supportate in base ai loro contenuti.

Internazionalizzazione

Android 16 aggiunge funzionalità e capacità che completano l'esperienza utente quando un dispositivo viene utilizzato in lingue diverse.

Testo verticale

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

Personalizzazione del sistema di misurazione

用户现在可以在“设置”中的地区偏好设置中自定义测量系统。用户偏好设置包含在语言区域代码中,因此您可以在 ACTION_LOCALE_CHANGED 上注册 BroadcastReceiver,以便在地区偏好设置发生更改时处理语言区域配置更改。

使用格式设置程序有助于提供符合当地体验的服务。例如,对于将手机设置为英语(丹麦)或将手机设置为英语(美国)并将公制作为首选测量系统的用户,“0.5 in”的英语(美国)对应于“12,7 mm”。

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