非推奨のサービスと機能

リリースのたびに、特定の Android API が古くなったり、デベロッパー エクスペリエンスの向上や新しいプラットフォーム機能のサポートのためにリファクタリングされたりすることがあります。このような場合は、古い API を正式に非推奨とし、代わりに使用できる代替 API をデベロッパーに案内します。

非推奨とは、API の公式サポートを終了したことを指しますが、デベロッパーは引き続き API を使用できます。このページでは、Android のこのリリースにおける主な非推奨化について説明します。その他の非推奨については、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.