淘汰項目

每個版本發布時,特定 Android API 可能會過時,或需要重構,才能提供更優質的開發人員體驗或支援新的平台功能。在這種情況下,我們會正式淘汰過時的 API,並引導開發人員改用其他 API。

淘汰表示我們已停止提供 API 的官方支援,但開發人員仍可繼續使用。本頁面列出這個 Android 版本中一些值得注意的淘汰項目。如要查看其他淘汰項目,請參閱 API 差異比較報表

改用 Spatializer 而非 Virtualizer

First added in Android 12 (API level 32), the Spatializer class lets apps query the capabilities and behavior of sound spatialization on the device. In Android 15, the Virtualizer class is deprecated. Use AudioAttributes.Builder.setSpatializationBehavior instead to characterize how you want your content to be played when spatialization is supported.

AndroidX media3 ExoPlayer 1.0 enables spatial audio by default for multichannel audio when the device supports it. See this recent blog post and the spatial audio documentation for more information, including APIs to control the feature.

Android WebView 中的 WebSQL 已淘汰

WebSettingssetDatabaseEnabledgetDatabaseEnabled 方法現已淘汰。這些設定已啟用支援功能 適用於 WebView 中的 WebSQLWebSQL 現已從 Chrome 中移除,現已淘汰 Android WebView 的運作方式這些方法將在未來 12 個月內,在所有 Android 版本上變成無操作。

全球資訊網協會 (W3C) 鼓勵需要網頁資料庫的應用程式採用 Web Storage API 技術,例如 localStoragesessionStorage,或 IndexedDB瀏覽器中的 SQLite Wasm 由來源私人檔案系統支援概述了以 SQLite 資料庫為基礎的替代技術組合,並編譯為 Web Assembly (Wasm),並由來源私人檔案系統支援,以便進一步直接遷移 WebSQL 程式碼。