Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Kullanmaya ilişkin iş akışında belirtildiği gibi,
izinleri (uygulamanız uygulama isteğinde bulunuyorsa)
bu izinleri uygulamanızın manifest dosyasında beyan etmeniz gerekir.
Bu beyanlar, uygulama mağazalarının ve kullanıcıların izin grubunu anlamasına yardımcı olur.
talep edebilir.
İzin isteme süreci, iznin türüne göre
izin:
İzin, yükleme zamanıysa
izni kullanabilirsiniz. Örneğin,
veya imza izni varsa izin otomatik olarak
yükleme süresidir.
Uygulamanızın isteyebileceği bir izni beyan etmek için uygun
<uses-permission> öğesi şurada:
uygulamanızın manifest dosyasına ekleyin. Örneğin, kameraya erişmesi gereken bir uygulama
AndroidManifest.xml içinde şu satırı içeriyor:
Bazı izinler:
CAMERA, uygulamanızı
yalnızca bazı Android cihazlarda bulunan donanım parçalarına erişebilir. Uygulamanız
sistemle ilişkili bu donanımlarla ilişkili
izin,
Uygulamanızın, bu özelliğe sahip olmayan bir cihazda çalışmaya devam edip edemeyeceğini düşünün
donanım. Çoğu durumda, donanım isteğe bağlı olduğundan
donanımını isteğe bağlı olarak android:requiredfalse olarak
<uses-feature> beyanı, as
bir AndroidManifest.xml dosyasından aşağıdaki kod snippet'inde gösterilmektedir:
Donanımın isteğe bağlı olduğunu beyan ederseniz uygulamanız
o donanıma sahip olmayan cihazlar. Cihazda belirli bir
bir donanım parçası olarak
hasSystemFeature()
yöntemini çağırın. Donanım mevcut değilse
ilgili özelliği uygulamanızda devre dışı bırakabilirsiniz.
Kotlin
// Check whether your app is running on a device that has a front-facing camera.if(applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)){// Continue with the part of your app's workflow that requires a// front-facing camera.}else{// Gracefully degrade your app experience.}
Java
// Check whether your app is running on a device that has a front-facing camera.if(getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)){// Continue with the part of your app's workflow that requires a// front-facing camera.}else{// Gracefully degrade your app experience.}
İzinleri API düzeyine göre bildirme
Yalnızca çalışma zamanında istenen izinleri destekleyen cihazlarda bir izin beyan etmek için
Android 6.0 (API düzeyi 23) veya sonraki sürümleri çalıştıran cihazlarda
<uses-permission-sdk-23>
öğesini kullanın
<uses-permission> öğesi.
Bu öğelerden birini kullanırken maxSdkVersion özelliğini ayarlayabilirsiniz.
Android'den daha yüksek bir sürümü çalıştıran cihazların
belirtilen değer için belirli bir izin gerekmez. Bu şekilde şunları yapabilirsiniz:
uyumluluk sağlamaya devam ederken gereksiz izinleri ortadan kaldırmalı
eski cihazlarda kullanılabilir.
Örneğin, uygulamanız fotoğraflar gibi medya içerikleri gösterebilir
kullanıcının uygulamanızda oluşturduğu içerikler veya videolar. Böyle bir durumda
bunu tek yapmanız gereken
READ_EXTERNAL_STORAGE
ve
uygulamanız hedeflediği sürece Android 10 (API düzeyi 29) veya sonraki sürümleri çalıştırmalıdır
Android 10 veya sonraki sürümler. Ancak, eski cihazlarla uyumluluk açısından
READ_EXTERNAL_STORAGE iznini beyan edip
android:maxSdkVersion - 28.
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-27 UTC."],[],[],null,["# Declare app permissions\n\nAs mentioned in the [workflow for using\npermissions](/training/basics/permissions#workflow), if your app requests app\npermissions, you must declare these permissions in your app's manifest file.\nThese declarations help app stores and users understand the set of permissions\nthat your app might request.\n\nThe process to request a permission depends on the type of\npermission:\n\n- If the permission is an [install-time\n permission](/guide/topics/permissions/overview#install-time), such as a normal permission or a signature permission, the permission is granted automatically at install time.\n- If the permission is a [runtime\n permission](/guide/topics/permissions/overview#runtime) or [special\n permission](/guide/topics/permissions/overview#special), and if your app is installed on a device that runs Android 6.0 (API level 23) or higher, you must request the [runtime permission](/training/permissions/requesting) or [special\n permission](/training/permissions/requesting-special) yourself.\n\n| **Caution:** Carefully consider which permissions to declare in your app's manifest. Add only the permissions that your app needs. For each permission that your app requests, make sure that it offers clear benefits to users and that the request is done in a way that's obvious to them.\n\nAdd declaration to app manifest\n-------------------------------\n\nTo declare a permission that your app might request, include the appropriate\n[`\u003cuses-permission\u003e`](/guide/topics/manifest/uses-permission-element) element in\nyour app's manifest file. For example, an app that needs to access the camera\nhas this line in `AndroidManifest.xml`: \n\n```xml\n\u003cmanifest ...\u003e\n \u003cuses-permission android:name=\"android.permission.CAMERA\"/\u003e\n \u003capplication ...\u003e\n ...\n \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\nDeclare hardware as optional\n----------------------------\n\nSome permissions, such as\n[`CAMERA`](/reference/android/Manifest.permission#CAMERA), let your app\naccess pieces of hardware that only some Android devices have. If your app\ndeclares one of these [hardware-associated\npermissions](/guide/topics/manifest/uses-feature-element#permissions-features),\nconsider whether your app can still run on a device that doesn't have that\nhardware. In most cases, hardware is optional, so it's better to declare the\nhardware as optional by setting `android:required` to `false` in your\n[`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element) declaration, as\nshown in the following code snippet from an `AndroidManifest.xml` file: \n\n```xml\n\u003cmanifest ...\u003e\n \u003capplication\u003e\n ...\n \u003c/application\u003e\n \u003cuses-feature android:name=\"android.hardware.camera\"\n android:required=\"false\" /\u003e\n\u003cmanifest\u003e\n```\n| **Caution:** If you don't set `android:required` to `false` in your `\u003cuses-feature\u003e` declaration, Android assumes that the hardware is required for your app to run. The system then [prevents some devices from being able to install your\n| app](/guide/topics/manifest/uses-feature-element#market-feature-filtering).\n\n### Determine hardware availability\n\nIf you declare hardware as optional, it's possible for your app to run on a\ndevice that doesn't have that hardware. To check whether a device has a specific\npiece of hardware, use the\n[`hasSystemFeature()`](/reference/android/content/pm/PackageManager#hasSystemFeature(java.lang.String))\nmethod, as shown in the following code snippet. If the hardware isn't available,\ngracefully disable that feature in your app. \n\n### Kotlin\n\n```kotlin\n// Check whether your app is running on a device that has a front-facing camera.\nif (applicationContext.packageManager.hasSystemFeature(\n PackageManager.FEATURE_CAMERA_FRONT)) {\n // Continue with the part of your app's workflow that requires a\n // front-facing camera.\n} else {\n // Gracefully degrade your app experience.\n}\n```\n\n### Java\n\n```java\n// Check whether your app is running on a device that has a front-facing camera.\nif (getApplicationContext().getPackageManager().hasSystemFeature(\n PackageManager.FEATURE_CAMERA_FRONT)) {\n // Continue with the part of your app's workflow that requires a\n // front-facing camera.\n} else {\n // Gracefully degrade your app experience.\n}\n```\n\nDeclare permissions by API level\n--------------------------------\n\nTo declare a permission only on devices that support runtime permissions---that\nis, devices that run Android 6.0 (API level 23) or higher---include the\n[`\u003cuses-permission-sdk-23\u003e`](/guide/topics/manifest/uses-permission-sdk-23-element)\nelement instead of the\n[`\u003cuses-permission\u003e`](/guide/topics/manifest/uses-permission-element) element.\n\nWhen using either of these elements, you can set the `maxSdkVersion` attribute\nto indicate that devices running a version of Android higher than\nthe specified value don't need a particular permission. This lets you\neliminate unnecessary permissions while still providing compatibility\nfor older devices.\n\nFor example, your app might show media content, such as photos\nor videos, that the user created while in your app. In this situation,\nyou don't need to use the\n[`READ_EXTERNAL_STORAGE`](https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE)\npermission on devices that\nrun Android 10 (API level 29) or higher, as long as your app targets\nAndroid 10 or higher. However, for compatibility with older devices,\nyou can declare the `READ_EXTERNAL_STORAGE` permission and set the\n`android:maxSdkVersion` to 28."]]