การเลิกใช้งาน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ในการเปิดตัวแต่ละครั้ง API ของ Android บางรายการอาจล้าสมัยหรือต้องมีการ
ปรับโครงสร้างใหม่เพื่อมอบประสบการณ์การใช้งานที่ดียิ่งขึ้นแก่นักพัฒนาแอปหรือรองรับความสามารถใหม่ๆ ของแพลตฟอร์ม
ในกรณีเหล่านี้ เราจะเลิกใช้งาน API ที่ล้าสมัยอย่างเป็นทางการและ
แนะนำให้นักพัฒนาแอปใช้ API อื่นแทน
การเลิกใช้งานหมายความว่าเราได้สิ้นสุดการสนับสนุน API อย่างเป็นทางการแล้ว แต่ API จะยังคงพร้อมให้บริการแก่นักพัฒนาแอปต่อไป หน้านี้จะไฮไลต์การเลิกใช้งานที่สำคัญบางอย่างใน Android รุ่นนี้ หากต้องการดูการเลิกใช้งานอื่นๆ
โปรดดูรายงานความแตกต่างของ API
ใช้ Spatializer แทน Virtualizer
คลาส Spatializer
เพิ่มเข้ามาครั้งแรกใน Android 12 (API ระดับ 32) ซึ่งช่วยให้แอปสามารถสอบถามความสามารถและลักษณะการจำลองเสียงเชิงพื้นที่ในอุปกรณ์ได้ ใน Android 15 ระบบจะเลิกใช้งานคลาส Virtualizer
ใช้ AudioAttributes.Builder.setSpatializationBehavior
แทนเพื่อระบุลักษณะที่ต้องการให้เนื้อหาเล่นเมื่อระบบรองรับการจัดวางเสียงเชิงพื้นที่
AndroidX media3 ExoPlayer 1.0 จะเปิดใช้เสียงรอบทิศทางโดยค่าเริ่มต้นสำหรับเสียงหลายช่องเมื่ออุปกรณ์รองรับ ดูข้อมูลเพิ่มเติมได้ในบล็อกโพสต์ล่าสุดนี้และเอกสารประกอบเกี่ยวกับเสียงรอบทิศทาง รวมถึง API เพื่อควบคุมฟีเจอร์
เลิกใช้งาน WebSQL ใน Android WebView
เราเลิกใช้งานเมธอด setDatabaseEnabled
และ getDatabaseEnabled
จาก WebSettings
แล้ว การตั้งค่าเหล่านี้เปิดใช้งานการสนับสนุนแล้ว
สำหรับ WebSQL ภายใน WebView ตอนนี้เราได้นํา WebSQL ออกจาก Chrome และเลิกใช้งานใน Android WebView แล้ว วิธีการเหล่านี้จะใช้งานไม่ได้ใน Android ทุกเวอร์ชันในอีก 12 เดือนข้างหน้า
World Wide Web Consortium (W3C) สนับสนุน
แอปที่ต้องใช้ฐานข้อมูลเว็บในการนำ Web Storage API
เทคโนโลยี เช่น localStorage
และ sessionStorage หรือ
IndexedDB SQLite Wasm ในเบราว์เซอร์ที่รองรับระบบไฟล์ส่วนตัวของต้นทาง กล่าวถึงชุดเทคโนโลยีที่จะมาแทนที่ซึ่งอิงตามฐานข้อมูล SQLite โดยคอมไพล์เป็น Web Assembly (Wasm) และรองรับระบบไฟล์ส่วนตัวของต้นทาง เพื่อเปิดใช้การย้ายข้อมูลโดยตรงของโค้ด WebSQL มากขึ้น
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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."]]