With each release, specific Android APIs might become obsolete or need to be refactored to provide a better developer experience or support new platform capabilities. In these cases, we officially deprecate the obsolete APIs and direct developers to alternative APIs to use instead.
Deprecation means that we've ended official support for the APIs, but they will continue to remain available to developers. This page highlights some of the notable deprecations in this release of Android. To see other deprecations, refer to the API diff report.
Use Spatializer instead of Virtualizer
Spatializer 类最早在 Android 12(API 级别 32)中添加,可让应用查询设备上的声音空间化功能和行为。在 Android 15 中,Virtualizer 类已废弃。请改用 AudioAttributes.Builder.setSpatializationBehavior 来描述您希望在支持空间化时如何播放内容。
AndroidX media3 ExoPlayer 1.0 会在设备支持的情况下,默认为多声道音频启用空间音频。如需了解详情(包括用于控制此功能的 API),请参阅这篇近期博文和空间音频文档。
WebSQL deprecated in Android WebView
The setDatabaseEnabled and getDatabaseEnabled
methods from WebSettings are now deprecated. These settings activated support
for WebSQL inside Webview. WebSQL is now removed in Chrome and is now deprecated
on Android Webview. These methods will become a no-op on all Android versions in
the next 12 months.
The World Wide Web Consortium (W3C) encourages apps needing web databases to adopt Web Storage API technologies like localStorage and sessionStorage, or IndexedDB. SQLite Wasm in the browser backed by the Origin Private File System outlines a replacement set of technologies based on the SQLite database, compiled to Web Assembly (Wasm), and backed by the origin private file system to enable more direct migration of WebSQL code.