非推奨のサービスと機能

リリースごとに、特定の Android API が古くなるか、廃止される デベロッパー エクスペリエンスの向上や新しいプラットフォームのサポートのためにリファクタリングされた 提供しますこのような場合は、廃止された API を正式に非推奨化し、 代わりに使用する代替 API をデベロッパーに提示します。

非推奨とは、API の公式サポートを終了したことですが、今後 引き続きデベロッパーが利用できるようになっています。このページでは 重要なサポートを終了しました。他の非推奨化を確認するには API 差分レポートをご覧ください。

Virtualizer の代わりに Spatializer を使用する

Android 12(API レベル 32)で初めて追加された Spatializer クラスにより、アプリはデバイスのサウンド空間化の機能と動作をクエリできます。Android 15 では、Virtualizer クラスが非推奨になります。代わりに AudioAttributes.Builder.setSpatializationBehavior を使用して、空間化がサポートされている場合にコンテンツをどのように再生するかを指定します。

AndroidX media3 ExoPlayer 1.0 は、デバイスがマルチチャンネル オーディオをサポートしている場合、デフォルトで空間オーディオを有効にします。この機能を制御する API などの詳細については、こちらの最近のブログ投稿空間オーディオのドキュメントをご覧ください。

Android WebView で WebSQL のサポート終了

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.