Application developers regularly face the need to request permissions - be it access to the camera, geolocation or contacts. With the release of Android-applications regularly face the need to request permissions - be it access to the camera, geolocation or contacts. With the exit Android 6.0 (Marshmallow) the permission system has undergone dramatic changes: many permissions now require not only a declaration at AndroidManifest.xmlbut also an explicit request at runtime (runtime permissions). This article will help you understand how to properly implement permission request in 2026, taking into account the latest platform updates and security best practices.

We will look at the entire process - from the basic declaration in the manifest to handling user responses, including the specifics of working with Android 13 (API 33) and Android 14 (API 34). We will pay special attention to typical errors that lead to application crashes or access denials, as well as the nuances of working with permissions for different OS versions. If you are just starting to develop under Android or want to update your knowledge, this guide is for you.

1. Types of permissions in Android: normal, dangerous and special

In Android all permissions are divided into three categories, each of which requires its own approach to the request. Understanding this classification is the basis for correct implementation.

Normal permissions (normal permissions) are automatically provided by the system when installing the application. They do not require an explicit request at runtime. Examples:

  • ๐Ÿ“ถ android.permission.INTERNET โ€” network access
  • ๐Ÿ”Š android.permission.VIBRATE โ€”device vibration
  • โฐ android.permission.WAKE_LOCK โ€”preventing screen sleep

Dangerous permissions (dangerous permissions) โ€”the most critical group. They require the userโ€™s explicit consent while the application is running. These include include:

  • ๐Ÿ“ธ android.permission.CAMERA โ€” access to the camera
  • ๐Ÿ“ android.permission.ACCESS_FINE_LOCATION โ€” precise geolocation
  • ๐Ÿ“ž android.permission.READ_CONTACTS โ€” reading contacts
  • ๐Ÿ’พ android.permission.READ_EXTERNAL_STORAGE โ€” access to files (up to Android 10)

Special permissions (special permissions) - rarely used permissions that require either manual configuration in system settings or additional steps. Examples:

  • ๐Ÿ”’ android.permission.SYSTEM_ALERT_WINDOW โ€” display on top of other applications
  • ๐Ÿ“ฑ android.permission.WRITE_SECURE_SETTINGS โ€” changing system settings
  • ๐Ÿ”„ android.permission.BIND_NOTIFICATION_LISTENER_SERVICE โ€” access to notifications
โš ๏ธ Attention: Starting from Android 10 (API 29), permission WRITE_EXTERNAL_STORAGE limited scoped storage. To work with files, use MediaStore or Storage Access Framework.
๐Ÿ“Š What permissions do you most often request in your applications?
Geolocation
Camera
Storage
Contact
Others

2. Declaration of permissions in AndroidManifest.xml

The first step is to declare the necessary permissions in file AndroidManifest.xml. Without this, the system will not even allow the application to request permission from the user.

Add the necessary permissions inside the tag <manifest>:

<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

For permissions related to hardware capabilities (for example, camera or Bluetooth), you also need to specify the tag <uses-feature>, so Google Play can filter devices that do not support these features:

<uses-feature android:name="android.hardware.camera" android:required="false" />

Starting with Android 12 (API 31), the ACCESS_BACKGROUND_LOCATION permission requires an explicit setting in the manifest, even if it is requested as part of the LOCATION group.

Resolution Group Requires a runtime request? Features
CAMERA Camera Yes Requires <uses-feature>
READ_EXTERNAL_STORAGE Storage Yes (up to API 33) Replaced by READ_MEDIA_IMAGES in API 33+
ACCESS_FINE_LOCATION Location Yes Includes ACCESS_COARSE_LOCATION
RECORD_AUDIO Microphone Yes Requires explanation when requested
โš ๏ธ Attention: If your application is targeted Android 13 (API 33) or higher, permissions for accessing media files (READ_EXTERNAL_STORAGE) are replaced with more granular ones: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO i READ_MEDIA_AUDIO.

3. Requesting permissions at runtime (Runtime Permissions)

For dangerous permissions, only declaration in manifest - they need to be requested while the application is running. The process includes three key steps:

  1. Checking the current status โ€”whether permission needs to be requested.
  2. Requesting permission โ€”calling the system dialog.
  3. Response processing โ€”actions depending on the user's choice.

Example of requesting permission for a camera on Kotlin:

// 1. Checking status

if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)

!= PackageManager.PERMISSION_GRANTED) {

// 2. Requesting permission

ActivityCompat.requestPermissions(

this,

arrayOf(Manifest.permission.CAMERA),

REQUEST_CAMERA_PERMISSION

)

} else {

// Permission has already been granted

openCamera()

}

To process the response, override the method onRequestPermissionsResult:

override fun onRequestPermissionsResult(

requestCode: Int,

permissions: Array<String>,

grantResults: IntArray

) {

when (requestCode) {

REQUEST_CAMERA_PERMISSION -> {

if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {

openCamera()

} else {

showPermissionDeniedMessage()

}

}

}

}

In Android 11 (API 30) and above it is recommended to use ActivityResultContracts.RequestPermission() instead of the outdated one onRequestPermissionsResult:

private val requestPermissionLauncher = registerForActivityResult(

ActivityResultContracts.RequestPermission()

) { isGranted ->

if (isGranted) {

openCamera()

} else {

showPermissionDeniedMessage()

}

}

// Call

requestPermissionLauncher.launch(Manifest.permission.CAMERA)

โ˜‘๏ธ Preparing to request permission

Done: 0 / 5

4. Explanation of the need for permissions (Permission Rationale)

Starting from Android 6.0, if the user has previously rejected the permission request, the system will show a dialog with checkbox "Do not ask again". In this case, a repeated request via requestPermissions() will not show the dialog, but will immediately return a refusal. To avoid this, before the request you need to explain to the user why the application needs permission.

Use the shouldShowRequestPermissionRationale():

if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {

// Show an explanation (for example, AlertDialog)

showPermissionExplanationDialog()

} else {

// Request permission or redirect to settings

requestPermissionLauncher.launch(Manifest.permission.CAMERA)

}

Examples of explanations for the user:

  • ๐Ÿ“ธ "Access to the camera needed to scan QR codes and create a profile photo."
  • ๐Ÿ“ "Geolocation helps show nearby stores and optimize routes."
  • ๐Ÿ’พ "Access to files required to download and save your documents."
โš ๏ธ Attention: Do not overuse explanations - they should be short and specific. Long texts irritate users and increase the likelihood of refusal.
๐Ÿ’ก

Use icons and illustrations in explanation dialogues - visual accompaniment increases user trust by 30% (according to Google UX research).

5. Handling permanent denial and redirecting to settings

If the user selected "More. do not ask" and denied the permission, calling again requestPermissions() will not show the dialog. In this case, you need to redirect the user to the application settings, where he can manually enable the permission.

Check for permanent refusal:

if (!ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA) &&

ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {

// Redirect to settings

val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)

intent.data = Uri.fromParts("package", packageName, null)

startActivity(intent)

}

It is important to warn the user that he will be redirected to settings. Example message:

"Permission deniedTo use the camera, enable access in the application settings Click 'OK' to proceed. go there now."

Some manufacturers (Xiaomi, Huawei, Oppo) modify Android and add additional levels of permissions. In such cases, you may need to:

  • ๐Ÿ”ง Manually enable permission in "Settings โ†’ Permissions โ†’ Autorun" (for background tasks).
  • ๐Ÿ“ฑ Resolution "Show on top of other applications" for overlay windows.
  • ๐Ÿ”„ Separate permission for "Changes to system settings" (for example, screen brightness).
What to do if the user does not return from the settings?

If the user does not return to the application after redirections to the settings, implement a permission check in onResume():

override fun onResume() {

super.onResume()

if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {

openCamera()

}

}

6. Features of working with permissions in Android 13 and 14

Android 13 (API 33) i Android 14 (API 34) have made significant changes to the permissions system, especially for working with media files and notifications.

Main changes in API 33:

  • ๐Ÿ–ผ๏ธ Resolution READ_EXTERNAL_STORAGE outdated. Instead, use:
    • READ_MEDIA_IMAGES โ€” access to photos
    • READ_MEDIA_VIDEO โ€” access to video
    • READ_MEDIA_AUDIO โ€” access to audio files
  • ๐Ÿ”” New resolution POST_NOTIFICATIONS โ€”required for displaying notifications (previously did not require an explicit request).
  • ๐Ÿ“ฑ Permission NEARBY_WIFI_DEVICES replaces ACCESS_FINE_LOCATION for scanning Wi-Fi devices.

An example of requesting permission for notifications:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {

requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)

}

Changes in API 34 (Android 14):

  • ๐Ÿ“ Access to files of other applications through MediaStore.
  • ๐Ÿ”’ Permission has been introduced READ_MEDIA_VISUAL_USER_SELECTED for access only to user-selected media files.
  • ๐Ÿ“ Requirements for background geolocation - now requires explicit permission ACCESS_BACKGROUND_LOCATION even for foreground services.
โš ๏ธ Attention: Starting Android 14, applications targeting API 34+ must request READ_MEDIA_VISUAL_USER_SELECTED instead of broad permissions for media files, unless they need access to ALL files on the device.
๐Ÿ’ก

With Android 13 notifications permission has become mandatory. Without it, your push notifications will not be shown, even if they are critical to the functionality of the application.

7. data-i="196">Even experienced developers make mistakes when working with permissions. Here are the most common problems and how to avoid them:

Even experienced developers make mistakes when working with permissions. Here are the most common problems and how to avoid them:

Error 1: Asking for all permissions at once at startup

Users are more likely to deny permissions if they see a long list when they first open it. Solution: request permissions as needed (for example, camera permission - only when the user clicks the "Take Photo" button).

Error 2: Ignoring the Android version

Code running on Android 10may cause a crash on Android 13. Always check the OS version:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {

// Logic for Android 13+

} else {

// Logic for older versions

}

Error 3: Lack of processing of โ€œpartialโ€ consent

If you request several permissions at once (for example, camera + microphone), the user can only agree to one. Always check the status of each permission separately:

if (grantResults.isNotEmpty()) {

val cameraGranted = grantResults[0] == PackageManager.PERMISSION_GRANTED

val microphoneGranted = grantResults[1] == PackageManager.PERMISSION_GRANTED

// Process each result separately

}

Error 4: Forgetting to test on different manufacturers

Manufacturers (Samsung, Xiaomi, Huawei) often modify the behavior of permissions. Test the application on devices of different brands, especially if you use:

  • ๐Ÿ”„ Background services
  • ๐Ÿ“ฑ Overlay windows
  • ๐Ÿ”‹ Battery optimization

Error 5: Unclear explanations for the user

The phrase "This application needs permissions to work" is not informative. Indicate a specific reason:

Bad: "Requires access to contacts."
Good: "Access to contacts is needed to quickly select a message recipient. We do not transfer your contacts to the server."

8. Tools for debugging permissions

If permissions are not working as expected, use these diagnostic tools:

1. ADB commands to check permissions

View all application permissions:

adb shell dumpsys package <package_name> | grep "grant"

Reset permissions for testing:

adb shell pm revoke <package_name> android.permission.CAMERA

adb shell pm grant <package_name> android.permission.CAMERA

2. Android Studio Profiler

Use Logcat with a filter by tag "PackageManager"to track events related to permissions.

3. Libraries to simplify work

  • ๐Ÿ› ๏ธ PermissionsDispatcher โ€” annotations for automatic generation of request code.
  • ๐Ÿ”ง EasyPermissions โ€” simplified processing of permissions from Google.
  • ๐Ÿ“ฆ AndroidX Activity Result APIs - a modern way of working with permissions (recommended by Google).

4. Testing on an emulator

The emulator Android Studio allows you to simulate different failure scenarios. For example, to test a permanent failure:

  1. Run the application on the emulator.
  2. Reject permission and check the "Don't ask again".
  3. Check whether the application correctly redirects to settings.
๐Ÿ’ก

To automatically test permissions in CI/CD use UI Automator or Espresso with system dialog mocks.

FAQ: Frequently asked questions about permissions in Android

โ“ How to request permission for notifications in Android 13?

Starting c Android 13 (API 33), showing notifications requires permission POST_NOTIFICATIONS. Add it to the manifest and request it at runtime:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {

requestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)

}

Without this permission, notifications will not be shown, even if they are critical to the application logic.

โ“ Why the permission request does not show dialog?

This happens in two cases:

  1. The user previously selected "Don't ask again" and denied permission. Check this via shouldShowRequestPermissionRationale().
  2. Permission has already been granted. Check the status via ContextCompat.checkSelfPermission().

If this is the first case, redirect the user to the application settings.

โ“ How to request several permissions at once?

Use an array of permissions in requestPermissions():

ActivityCompat.requestPermissions(

this,

arrayOf(

Manifest.permission.CAMERA,

Manifest.permission.RECORD_AUDIO

),

REQUEST_CODE_MULTIPLE_PERMISSIONS

)

B onRequestPermissionsResult check the status of each permission separately by index in array grantResults.

โ“ Is it necessary to request READ_EXTERNAL_STORAGE in Android 13?

No, in Android 13 this permission is obsolete. Instead, use:

  • READ_MEDIA_IMAGES โ€” for photos
  • READ_MEDIA_VIDEO โ€” for video
  • READ_MEDIA_AUDIO โ€” for audio

If your application needs access to ALL media files, use READ_MEDIA_VISUAL_USER_SELECTED (the user selects specific files).

โ“ How to handle permissions on Xiaomi, Huawei and other devices manufacturers?

Some manufacturers add additional restrictions. For example:

  • Xiaomi: requires "Autostart" permission for background tasks.
  • Huawei: can block notifications if the application is not added to "Protected applications".
  • Oppo/Realme: you need to manually allow "Display on top of other applications" for overlays.

It is recommended to add a screen with instructions for popular brands to the application or use libraries like AndroidAutoStart.