- 構文:
<uses-permission-sdk-23 android:name="string" android:maxSdkVersion="integer" />
- 上位の要素:
<manifest>
- 説明:
-
Android 6.0(API レベル 23)以上を搭載したデバイスにアプリがインストールされている場合にのみ、アプリが特定の権限を要求するよう指定します。API レベル 22 以下のデバイスの場合、アプリは指定した権限を要求しません。
この要素は、アプリをアップデートして追加の権限が必要な新機能を組み込む場合に役立ちます。API レベル 22 以下を搭載したデバイスでユーザーがアプリをアップデートすると、インストール時に、そのアップデートで宣言されている新しい権限をすべて付与するよう求められます。新機能が軽微な場合は、デバイス全体で機能を完全に無効にすることをおすすめします。これにより、アプリをアップデートするために追加の権限を付与する必要がなくなります。
<uses-permission>
の代わりに<uses-permission-sdk-23>
要素を使用すると、アプリの実行中にのみ実行時の権限モデルをサポートするプラットフォーム上で、権限をリクエストできます。ユーザーはそのプラットフォームで、実行中のアプリに権限を付与します。権限についての詳細は、アプリ マニフェスト概要の権限のセクションと、Android での権限に関するガイドをご覧ください。ベース プラットフォームで定義されている権限のリストは、
android.Manifest.permission
で確認できます。 - 属性:
-
android:name
-
権限の名前。これは、
<permission>
要素でアプリが定義する権限、別のアプリが定義する権限、あるいは標準的なシステム権限("android.permission.CAMERA"
や"android.permission.READ_CONTACTS"
など)のいずれかである可能性があります。 android:maxSdkVersion
- この権限がアプリに付与される最大の API レベル。以降の API レベルを備えたデバイスにアプリをインストールする場合、アプリに権限は付与されず、関連機能を使用できません。
- 導入時の API レベル:
- API レベル 23
- 関連項目:
<uses-permission-sdk-23>
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 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)"]]