Bản không dùng nữa
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Với mỗi bản phát hành, một số API Android cụ thể có thể trở nên lỗi thời hoặc cần được tái cấu trúc để mang lại trải nghiệm tốt hơn cho nhà phát triển hoặc hỗ trợ các chức năng mới của nền tảng. Trong những trường hợp này, chúng tôi chính thức ngừng cung cấp các API lỗi thời và hướng dẫn nhà phát triển sử dụng các API thay thế.
Ngừng cung cấp có nghĩa là chúng tôi đã ngừng hỗ trợ chính thức cho các API này, nhưng các API này sẽ vẫn được cung cấp cho nhà phát triển. Trang này nêu bật một số điểm không dùng nữa đáng chú ý trong bản phát hành Android này. Để xem các thông báo ngừng sử dụng khác, hãy tham khảo báo cáo điểm khác biệt về API.
Sử dụng Spatializer thay vì Virtualizer
Được thêm lần đầu tiên trong Android 12 (API cấp 32), lớp Spatializer
cho phép ứng dụng truy vấn các chức năng và hành vi của tính năng âm thanh không gian trên thiết bị. Trong Android 15, lớp Virtualizer
không còn được dùng nữa. Thay vào đó, hãy sử dụng AudioAttributes.Builder.setSpatializationBehavior
để mô tả cách bạn muốn phát nội dung khi tính năng không gian được hỗ trợ.
AndroidX media3 ExoPlayer 1.0 bật âm thanh không gian theo mặc định cho âm thanh đa kênh khi thiết bị hỗ trợ âm thanh không gian. Hãy xem bài đăng gần đây trên blog này và tài liệu về âm thanh không gian để biết thêm thông tin, bao gồm cả các API để kiểm soát tính năng này.
WebSQL không được dùng nữa trong Android WebView
setDatabaseEnabled
và getDatabaseEnabled
các phương thức từ WebSettings
hiện không được dùng nữa. Các chế độ cài đặt này đã kích hoạt dịch vụ hỗ trợ
cho WebSQL bên trong Webview. WebSQL hiện đã bị xoá trong Chrome và không dùng nữa
trên Android Webview. Các phương thức này sẽ không hoạt động trên tất cả phiên bản Android ở
12 tháng tới.
Tổ chức World Wide Web Consortium (W3C) khuyến khích các ứng dụng cần cơ sở dữ liệu web sử dụng các công nghệ Web Storage API như localStorage và sessionStorage hoặc IndexedDB. SQLite Wasm trong trình duyệt được hỗ trợ
Nguồn gốc hệ thống tệp riêng tư
phác thảo một nhóm công nghệ thay thế dựa trên
cơ sở dữ liệu SQLite
được biên dịch thành Web bụi (wasm) và được hỗ trợ bởi
hệ thống tệp riêng tư gốc
để cho phép di chuyển trực tiếp hơn
của mã WebSQL.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-08-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-27 UTC."],[],[],null,["With each release, specific Android APIs might become obsolete or need to be\nrefactored to provide a better developer experience or support new platform\ncapabilities. In these cases, we officially deprecate the obsolete APIs and\ndirect developers to alternative APIs to use instead.\n\nDeprecation means that we've ended official support for the APIs, but they will\ncontinue to remain available to developers. This page highlights some of the\nnotable deprecations in this release of Android. To see other deprecations,\nrefer to the [API diff report](/sdk/api_diff/35/changes).\n\nUse Spatializer instead of Virtualizer\n\nFirst added in Android 12 (API level 32), the [`Spatializer`](/reference/android/media/Spatializer)\nclass lets apps query the capabilities and behavior of sound spatialization on\nthe device. In Android 15, the [`Virtualizer`](/reference/android/media/audiofx/Virtualizer) class is\ndeprecated. Use\n[`AudioAttributes.Builder.setSpatializationBehavior`](/reference/android/media/AudioAttributes.Builder#setSpatializationBehavior(int)) instead\nto characterize how you want your content to be played when spatialization is\nsupported.\n\nAndroidX media3 ExoPlayer 1.0 enables spatial audio by default for multichannel\naudio when the device supports it. See this\n[recent blog post](https://android-developers.googleblog.com/2023/04/delivering-immersive-sound-experience-with-spatial-audio.html) and the\n[spatial audio documentation](/media/grow/spatial-audio#exoplayer) for more information, including\nAPIs to control the feature.\n\nWebSQL deprecated in Android WebView\n\nThe [`setDatabaseEnabled`](/reference/android/webkit/WebSettings#setDatabaseEnabled(boolean)) and [`getDatabaseEnabled`](/reference/android/webkit/WebSettings#getDatabaseEnabled())\nmethods from `WebSettings` are now deprecated. These settings activated support\nfor WebSQL inside Webview. WebSQL is now removed in Chrome and is now deprecated\non Android Webview. These methods will become a no-op on all Android versions in\nthe next 12 months.\n\nThe World Wide Web Consortium (W3C) [encourages](https://www.w3.org/TR/webdatabase/#:%7E:text=The%20Web%20Applications%20Working%20Group%20continues%20work%20on%20two%20other%20storage%2Drelated%20specifications%3A%20Web%20Storage%20and%20Indexed%20Database%20API.)\napps needing web databases to adopt [Web Storage API](https://developer.mozilla.org/docs/Web/API/Web_Storage_API)\ntechnologies like [localStorage](https://developer.mozilla.org/docs/Web/API/Window/localStorage)\nand [sessionStorage](https://developer.mozilla.org/docs/Web/API/Window/sessionStorage), or\n[IndexedDB](https://developer.mozilla.org/docs/Web/API/IndexedDB_API/Using_IndexedDB). [SQLite Wasm in the browser backed by the\nOrigin Private File System](https://developer.chrome.com/blog/sqlite-wasm-in-the-browser-backed-by-the-origin-private-file-system)\noutlines a replacement set of technologies based on the\n[SQLite](https://sqlite.org/) database,\n[compiled to Web Assembly](https://sqlite.org/wasm) (Wasm), and backed by the\n[origin private file system](https://developer.mozilla.org/docs/Web/API/File_System_Access_API#origin_private_file_system)\nto enable more [direct migration](https://developer.chrome.com/blog/from-web-sql-to-sqlite-wasm/)\nof WebSQL code."]]