ความเข้ากันได้ของแอปใน Android
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สำหรับ Android คำว่าความเข้ากันได้ของแอปหมายความว่าแอปของคุณทำงานได้อย่างถูกต้องบนแพลตฟอร์มเวอร์ชันใดเวอร์ชันหนึ่ง โดยปกติจะเป็นเวอร์ชันล่าสุด
ในแต่ละ
รุ่น เราจะทำการเปลี่ยนแปลงที่สำคัญซึ่งช่วยปรับปรุงความเป็นส่วนตัวและความปลอดภัย และเราจะ
นำการเปลี่ยนแปลงที่พัฒนาประสบการณ์ของผู้ใช้โดยรวมในระบบปฏิบัติการมาใช้
บางครั้งการเปลี่ยนแปลงเหล่านี้อาจส่งผลต่อแอปของคุณ ดังนั้นคุณจึงควรดู
การเปลี่ยนแปลงลักษณะการทำงานที่รวมอยู่ในแต่ละเวอร์ชันที่เผยแพร่ ทดสอบกับ
การเปลี่ยนแปลงเหล่านั้น และเผยแพร่การอัปเดตความเข้ากันได้สำหรับผู้ใช้
เหตุใดความเข้ากันได้ของแอปจึงสำคัญ
ความเข้ากันได้ของแอปจะเริ่มส่งผลต่อผู้ใช้ทันทีเมื่ออัปเดตเป็น Android เวอร์ชันล่าสุด ไม่ว่าผู้ใช้จะซื้ออุปกรณ์ใหม่หรือติดตั้งการอัปเดตในอุปกรณ์ปัจจุบันก็ตาม ผู้ใช้ตื่นเต้นที่จะได้สำรวจ Android เวอร์ชันล่าสุด และต้องการสัมผัสประสบการณ์การใช้งานกับแอปโปรด หากแอปของพาร์ทเนอร์ทำงานไม่ถูกต้อง อาจทำให้เกิดปัญหาใหญ่ทั้งกับพาร์ทเนอร์และคุณ
ประเภทของการเปลี่ยนแปลงลักษณะการทำงานของแพลตฟอร์ม
แอปของคุณอาจได้รับผลกระทบจากการเปลี่ยนแปลง 2 ประเภทที่แตกต่างกันเมื่อทำงานบนแพลตฟอร์มเวอร์ชันใหม่ ดังนี้
การเปลี่ยนแปลงสำหรับแอปทั้งหมด
การเปลี่ยนแปลงเหล่านี้ส่งผลต่อแอปทั้งหมดที่ทำงานใน Android เวอร์ชันดังกล่าว ไม่ว่าแอปจะมี targetSdkVersion
ใดก็ตาม
คุณควรทดสอบความเข้ากันได้ของแอปกับการเปลี่ยนแปลงเหล่านี้อย่างเชิงรุกในระหว่าง
การเผยแพร่ตัวอย่างสำหรับนักพัฒนาแอปและเวอร์ชันเบต้าของ Android แต่ละเวอร์ชันใหม่ การอัปเดตสำหรับ
Pixel และอุปกรณ์อื่นๆ จะเริ่มทันทีที่ Android เวอร์ชันใหม่ถึงรุ่นสุดท้าย
ที่เผยแพร่ในโครงการโอเพนซอร์ส Android (AOSP) ดังนั้นเมื่อคุณทดสอบการเปลี่ยนแปลงเหล่านี้
อย่างเชิงรุก คุณจะช่วยให้ผู้ใช้เปลี่ยนไปใช้
Android เวอร์ชันล่าสุดในอุปกรณ์เหล่านี้ได้อย่างราบรื่น
การเปลี่ยนแปลงที่กำหนดเป้าหมาย
การเปลี่ยนแปลงเหล่านี้จะมีผลกับแอปที่กำหนดเป้าหมายเป็น Android เวอร์ชันดังกล่าวเท่านั้น
สำหรับการเปลี่ยนแปลงเหล่านี้ คุณควรทำการทดสอบความเข้ากันได้ขณะเตรียมกำหนดเป้าหมายเป็น API เวอร์ชันเสถียรล่าสุด ซึ่งคือ Android 16 (API ระดับ 36) แม้ว่าคุณจะไม่ได้วางแผนที่จะกำหนดเป้าหมาย Android เวอร์ชันใหม่ในทันที แต่การจัดการกับการเปลี่ยนแปลงเหล่านี้อาจต้องใช้เวลาในการพัฒนาเป็นอย่างมาก คุณควรศึกษาเกี่ยวกับการเปลี่ยนแปลงเหล่านี้โดยเร็วที่สุด ซึ่งก็คือในช่วงที่ Android เวอร์ชันใหม่แต่ละเวอร์ชันเปิดตัวตัวอย่างสำหรับนักพัฒนาซอฟต์แวร์และเบต้า เพื่อให้คุณทำการทดสอบเบื้องต้นและแสดงความคิดเห็นได้
เครื่องมือเฟรมเวิร์กความเข้ากันได้
เราได้รวมการเปลี่ยนแปลงที่ทำให้เกิดข้อขัดข้องให้มากที่สุดเท่าที่จะเป็นไปได้ในแต่ละรุ่นในเฟรมเวิร์กความเข้ากันได้เพื่อช่วยคุณทดสอบความเข้ากันได้ การรวมการเปลี่ยนแปลงใน
เฟรมเวิร์กความเข้ากันได้ทำให้สามารถสลับได้ ซึ่งช่วยให้คุณบังคับเปิดใช้หรือ
ปิดใช้การเปลี่ยนแปลงทีละรายการจากตัวเลือกสำหรับนักพัฒนาแอปหรือ ADB ได้ เมื่อใช้
เฟรมเวิร์กความเข้ากันได้ คุณไม่จำเป็นต้องเปลี่ยน targetSdkVersion
ของแอปหรือคอมไพล์แอปอีกครั้งสำหรับการทดสอบพื้นฐาน
ดูข้อมูลเพิ่มเติมได้ที่ทดสอบและแก้ไขข้อบกพร่องของการเปลี่ยนแปลงลักษณะการทำงานของแพลตฟอร์มในแอป
ข้อจำกัดเกี่ยวกับอินเทอร์เฟซที่ไม่ใช่ SDK
เราพยายามอย่างต่อเนื่องที่จะค่อยๆ เปลี่ยนให้นักพัฒนาแอปหันมาใช้ API ที่ไม่ใช่ SDK
เราจึงอัปเดตรายการอินเทอร์เฟซที่ไม่ใช่ SDK ที่ถูกจำกัดใน Android
แต่ละรุ่น และเช่นเคย เรายินดีรับฟังความคิดเห็นและคำขอ API สาธารณะที่เทียบเท่า
ดูข้อมูลเพิ่มเติมเกี่ยวกับ Android รุ่นล่าสุด
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["For Android, the term *app compatibility* means that your app runs properly on a\nspecific version of the platform, typically the latest version. With each\nrelease, we make integral changes that improve privacy and security, and we\nimplement changes that evolve the overall user experience across the OS.\nSometimes these changes can affect your apps, so it's important to take a look\nat the behavior changes that are included in each released version, test against\nthem, and publish compatibility updates for your users.\n\nWhy app compatibility is important\n\nApp compatibility starts to affect your users immediately when they update to\nthe latest version of Android, whether they've purchased a new device or\ninstalled an update on their current device. They're excited to explore the\nlatest version of Android, and they want to experience it with their favorite\napps. If their apps don't work properly, it can cause major issues both for them\nand for you.\n\nTypes of platform behavior changes\n\nYour app can be affected by two different types of changes when running on a new\nplatform version:\n\nChanges for all apps\n\nThese changes affect all apps that run on that version of Android, regardless of\nan app's `targetSdkVersion`.\n\nYou should test your app's compatibility with these changes proactively during\nthe developer preview and beta releases of each new Android version. Updates to\nPixel and other devices start as soon as a new Android version reaches its final\nrelease to [Android Open Source Project (AOSP)](https://source.android.com/), so when you test proactively\nfor these changes, you help ensure that your users can seamlessly transition to\nthe latest Android version on these devices.\n\nTargeted changes\n\nThese changes only affect apps that are targeting that version of Android.\n\nFor these changes, you should perform compatibility testing as you prepare to\n[target the latest stable API version](/distribute/best-practices/develop/target-sdk), which is\nAndroid 16 (API level 36). Even if you aren't planning to target a new\nAndroid version immediately, addressing these changes can require a significant\namount of development. You should learn about these changes as early as\npossible---ideally during the developer preview and beta releases of each new\nAndroid version---so you can do preliminary testing and provide feedback.\n\nCompatibility framework tools\n\nTo help you test for compatibility, we include as many of the breaking changes\nas possible each release in the compatibility framework. Including a change in\nthe compatibility framework makes it toggleable, letting you force-enable or\ndisable the changes individually from developer options or ADB. When using the\ncompatibility framework, you don't need to change your app's `targetSdkVersion`\nor recompile your app for basic testing.\n\nTo learn more, see [Test and debug platform behavior changes in your app](/guide/app-compatibility/test-debug).\n\nRestrictions on non-SDK interfaces\n\nAs part of our ongoing effort to gradually move developers away from non-SDK\nAPIs, we update the [lists of restricted non-SDK interfaces](/guide/app-compatibility/restrictions-non-sdk-interfaces) in each Android\nrelease. As always, your feedback and [requests for public API equivalents](/guide/app-compatibility/restrictions-non-sdk-interfaces#feature-request)\nare welcome.\n\nPlatform releases\n\nLearn more about the latest Android releases:\n\n- [Android 15 (API level 35)](/about/versions/15)\n- [Android 14 (API level 34)](/about/versions/14)\n- [Android 13 (API level 33)](/about/versions/13)\n- [Android 12 (API levels 31, 32)](/about/versions/12)\n- [Android 11 (API level 30)](/about/versions/11)"]]