- ไวยากรณ์:
<uses-permission-sdk-23 android:name="string" android:maxSdkVersion="integer" />
- ที่อยู่ใน:
<manifest>
- description:
-
ระบุว่าแอปต้องการสิทธิ์บางอย่างโดยเฉพาะ เมื่อแอปนั้น
ที่ติดตั้งในอุปกรณ์ที่ใช้ Android 6.0 (API ระดับ 23) ขึ้นไป หากอุปกรณ์
ใช้ API ระดับ 22 หรือต่ำกว่า แอปไม่ต้องการให้ระบุ
สิทธิ์
องค์ประกอบนี้มีประโยชน์เมื่อคุณอัปเดตแอปให้รวม ฟีเจอร์ที่จำเป็นต้องมีสิทธิ์เพิ่มเติม หากผู้ใช้อัปเดตแอปบน อุปกรณ์ที่ใช้ API ระดับ 22 หรือต่ำกว่า ระบบจะแจ้งเตือนผู้ใช้ ณ เวลาติดตั้งเพื่อให้สิทธิ์ใหม่ทั้งหมดที่มีการประกาศไว้ อัปเดต หากฟีเจอร์ใหม่มีขนาดเล็กพอ คุณอาจต้องปิดใช้ ฟีเจอร์ทั้งหมดได้ในอุปกรณ์เหล่านั้น ผู้ใช้จึงไม่ต้องอนุญาต สิทธิ์เพิ่มเติมในการอัปเดตแอป
โดยการใช้ องค์ประกอบ
<uses-permission-sdk-23>
แทนที่จะเป็น<uses-permission>
คุณสามารถขอสิทธิ์ก็ต่อเมื่อแอปทำงานอยู่ แพลตฟอร์มที่รองรับสิทธิ์รันไทม์ ซึ่งผู้ใช้ ให้สิทธิ์กับแอปขณะทํางานสำหรับข้อมูลเพิ่มเติมเกี่ยวกับสิทธิ์ โปรดดูที่สิทธิ์ ในภาพรวมไฟล์ Manifest ของแอปและสิทธิ์บน Android รายการสิทธิ์ที่กำหนดโดยแพลตฟอร์มพื้นฐานจะพร้อมใช้งาน ที่
android.Manifest.permission
- ดังนี้
-
android:name
-
ชื่อของสิทธิ์ สิทธิ์นี้สามารถกำหนดโดย
แอปที่มี
<permission>
อาจเป็นสิทธิ์ที่กำหนดโดยแอปอื่นหรือสิทธิ์หนึ่งๆ สิทธิ์มาตรฐานของระบบ เช่น วันที่"android.permission.CAMERA"
หรือ"android.permission.READ_CONTACTS"
android:maxSdkVersion
- ระดับ API สูงสุดที่ได้รับสิทธิ์นี้ แอป หากแอปติดตั้งในอุปกรณ์ที่มีระดับ API ใหม่กว่า แอป ไม่ได้รับสิทธิ์และจะใช้ฟังก์ชันการทำงานที่เกี่ยวข้องไม่ได้
- เปิดตัวใน
- API ระดับ 23
- ดูเพิ่มเติม
<uses-permission-sdk-23>
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-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-07-27 UTC"],[],[],null,["# <uses-permission-sdk-23\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cuses-permission-sdk-23 android:name=\"string\"\n android:maxSdkVersion=\"integer\" /\u003e\n ```\n\ncontained in:\n: [\u003cmanifest\u003e](/guide/topics/manifest/manifest-element)\n\n\ndescription:\n\n: Specifies that an app wants a particular permission, but only if the app is installed on a device running Android 6.0 (API level 23) or higher. If the device runs API level 22 or lower, the app doesn't want the specified permission.\n This element is useful when you update an app to include a new\n feature that requires an additional permission. If a user updates an app on a\n device that is running API level 22 or lower, the system prompts the user\n at install time to grant all new permissions that are declared in that\n update. If a new feature is minor enough, you might prefer to disable\n the feature altogether on those devices, so the user doesn't have to grant\n additional permissions to update the app.\n\n By using the\n `\u003cuses-permission-sdk-23\u003e` element instead of [`\u003cuses-permission\u003e`](/guide/topics/manifest/uses-permission-element),\n you can request the permission *only* if the app is running on\n platforms that support the [runtime permissions](/training/permissions/requesting)\n model, in which the user\n grants permissions to the app while it is running.\n\n\n For more information on permissions, see the [Permissions](/guide/topics/manifest/manifest-intro#perms)\n section in the app manifest overview and the [Permissions on Android](/guide/topics/permissions)\n guide. A list of permissions defined by the base platform is available\n at [android.Manifest.permission](/reference/android/Manifest.permission).\n\nattributes:\n:\n\n `android:name`\n :\n The name of the permission. This permission can be one defined by the\n app with the [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n element, it can be a permission defined by another app, or it can be one\n of the standard system permissions, such as\n [\"android.permission.CAMERA\"](/reference/android/Manifest.permission#CAMERA)\n or [\"android.permission.READ_CONTACTS\"](/reference/android/Manifest.permission#READ_CONTACTS).\n\n `android:maxSdkVersion`\n :\n The highest API level at which this permission is granted to your\n app. If the app installs on a device with a later API level, the app\n isn't granted the permission and can't use any related functionality.\n\nintroduced in:\n: API level 23\n\nsee also:\n:\n - [\u003cpermission\u003e](/guide/topics/manifest/permission-element)\n - [`\u003cuses-permission\u003e`](/guide/topics/manifest/uses-permission-element)\n - [\u003cuses-feature\u003e](/guide/topics/manifest/uses-feature-element)"]]