Questions tagged [runtime-permissions]

This tag refers to Android runtime permissions introduced with Android 6.0 Marshmallow (API level 23). Previously permissions were granted on installation of an app. As of API level 23 permissions need to be requested at runtime.

Runtime permissions for Android were introduced in version 6.0 Marshmallow (API level 23).

The permissions are categorized into different protection levels and groups. For the dangerous level the permission must be requested at runtime, in contrast to normal permissions that are granted at install time. The user can revoke a previously granted permission anytime.

See also:

315 questions
69
votes
16 answers

How to check the multiple permission at single request in Android M?

I want to use the android.permission.CAMERA android.permission.WRITE_EXTERNAL_STORAGE in single request using ActivityCompat.requestPermissions(Activity activity,new String permisionList[],int permissionRequestcode); But my problem is at time I…
Zala Janaksinh
  • 2,929
  • 5
  • 32
  • 58
58
votes
5 answers

Android 13 - How to request WRITE_EXTERNAL_STORAGE

I am targeting my Android app for Android 13 (API 33) The WRITE_EXTERNAL_STORAGE permission seems to be working fine below API 33 i.e. Android 12 and less but the runtime permission popup for WRITE_EXTERNAL_STORAGE won't appear when running the app…
56
votes
3 answers

Android Studio - remove Security Exception warning

I'm getting the user's location through Location location = LocationServices.FusedLocationApi.getLastLocation( mGoogleApiClient); This line of code is inside a method and before calling this method I do check for Android run time…
29
votes
6 answers
28
votes
1 answer

How to debug/reset Android 6.0 permissions?

While migrating one of my apps to use the Android 6.0 permissions system, I found it very hard to debug permissions using the emulator. Findings: Disabling a permission in the app info screen doesn't re-show the grant permission dialog when using…
24
votes
7 answers

How to ask permission to make phone call from Android from Android version Marshmallow onwards?

I am trying to make a phone call from Android, and I've set run time permissions as well. And it asks whether to allow making phone calls. But when I press allow, the app crashes: This is how I implemented it: private static final int…
OBX
  • 6,044
  • 7
  • 33
  • 77
18
votes
11 answers

How to ask runtime permissions for Camera in Android , Runtime storage permissions

I am doing an application to scan barcodes on a button click and it was working fine up to Lollipop versions. When I came to Marshmallow it stopped working. This is the error: camerabase an error occurred while connecting to camera 0 It forces me…
15
votes
1 answer

onRequestPermissionsResult not working in fragment

i'm trying to implement Marshmallow's permission support, but my code inside "onRequestPermissionsResult" is never called. When working in an Activity its working but in fragment I am facing the problem i.e, the control is not coming in…
14
votes
2 answers

Proper Way of Requesting WRITE_EXTERNAL_STORAGE Permission

I have struggled trying to figure out how the storage system work on Android. Now I am stuck at requesting permission for WRITE_EXTERNAL_STORAGE, and I am using Android 7.1.1. Here is my code: int check = ActivityCompat.checkSelfPermission(this,…
x1uan
  • 153
  • 1
  • 2
  • 8
13
votes
4 answers

Android API 33 permissions are not granted

So as I read in the developer.android site the Android 13 brings new changes in the Permission field. I have a Chat application where I need to make calls, open the camera, record audio, read and write in the external storage. So in the SplashScreen…
james04
  • 1,580
  • 2
  • 20
  • 46
13
votes
11 answers

When to request permission at runtime for Android Marshmallow 6.0?

I am testing my app on Marshmallow 6.0 and it's getting force closed for the android.permission.READ_EXTERNAL_STORAGE, even if it is defined in the Manifest already. Somewhere I have read that if I request permission at runtime then it would not…
Pankaj
  • 7,908
  • 6
  • 42
  • 65
12
votes
2 answers

How to ask permission (RunTime) again if the user deny for the first time

I want to re ask the permission to the user in the situation if he/she deny for the first time. I have set the permission but my app runs even if I press deny option. I have a code which should do the things which I want to do but I get Cant resolve…
10
votes
2 answers

In onRequestPermissionsResult grantResults on some device return empty when user decline the permission

In Shot:, In onRequestPermissionsResult grantResults on some device return empty and some device have a value PackageManager.PERMISSION_DENIED when user decline the permission. I have implmeneted a solution for identify user has selected accepted…
MJM
  • 5,119
  • 5
  • 27
  • 53
10
votes
2 answers

How to avoid writing duplicate boilerplate code for requesting permissions?

I'm updating my app to be Android 6-compatible. The permission model is not very complex in theory, but now I'm in the process of implementing it and I find myself writing the same ugly boilerplate code in every one of my activities that require…
Tim
  • 41,901
  • 18
  • 127
  • 145
9
votes
1 answer

How to read receive sms without permission in Android

In some applications i see read receive SMS for get active code! But for read this message not allowed any permission! My android version is 28 and i know in 23 or above for read messages we get runtime permission from users! In this application how…
Jake warton
  • 2,163
  • 4
  • 11
  • 20
1
2 3
20 21