Questions tagged [android-permissions]

Permissions in the AndroidManifest.xml that allows an app to perform certain actions that are disallowed by default

3946 questions
53
votes
4 answers

Permission Denial while sharing file with FileProvider

I am trying to share file with FileProvider. I checked that file is shared properly with apps like Gmail, Google Drive etc. Even though following exception is thrown: 2019-08-28 11:43:03.169 12573-12595/com.example.name E/DatabaseUtils: Writing…
53
votes
9 answers

How to check Grants Permissions at Run-Time?

In Android M (Preview) the user can choose a specific app and retreive specific permission. So I am asking How to check Grants Permissions at Run-Time?
TooCool
  • 10,598
  • 15
  • 60
  • 85
51
votes
4 answers

How to check if Android Permission is actually being used?

I am maintaining one existing (very-huge, very-sensitive) Android Application. The other day, I have received an email from my client that, the Application might be declaring the Permissions that are not actively being used. For example, they…
Aung Pyae
  • 1,590
  • 2
  • 16
  • 25
49
votes
3 answers

USE_FINGERPRINT is deprecated in API level 28

Constant USE_FINGERPRINT was deprecated in API level 28 and we should use more generic USE_BIOMETRIC which has been added in same API level. I swap these constants in my Manifest and I'm getting error when calling…
48
votes
2 answers

How does storage access change on Android 6?

Background Android had a lot of changes as to how to handle the SD-card and storage in general: API 3 - you get all access, no permission needed API 4-15 - you need to use WRITE_EXTERNAL_STORAGE, and you get all access. API 16-18 - if you wish only…
46
votes
5 answers

Latest update on enabling and disabling mobile data programmatically

Although this is a "duplicate", the current answers are out of date and, mostly, no longer apply. I thought it would be good to provide an updated resource here, if possible, to save people time, as I have just done, researching this issue. I've…
user3956566
45
votes
3 answers

checkSelfPermission method is not working in targetSdkVersion 22

CheckSelfPermission method is not working as expected and it is always returning zero in android 6.0(Marshmallow). Because the target sdk is 22 and i am using http Client for network connection. Following is the code snippet. private void…
Mithun S
  • 453
  • 1
  • 4
  • 9
45
votes
1 answer

Android: what to choose for requestcode values?

Methods like ActivityCompat.requestPermissions require that I pass them a requestcode that I can later test in a callback (in this case onRequestPermissionsResult). Is there some best practice sort of value I'm supposed to pass in the requestcode?…
45
votes
5 answers

Can you request permissions synchronously in Android Marshmallow (API 23)'s runtime permissions model?

Say you have a method like this: public boolean saveFile (Url url, String content) { // save the file, this can be done a lot of different ways, but // basically the point is... return save_was_successful; } Throughout your app, if you…
fattire
  • 6,823
  • 3
  • 25
  • 38
43
votes
1 answer

Optional permissions so an app can show on all devices and enable optional features on some?

Many features in Android require a uses-permission to be set in the manifest. These values then determine what devices will see them in the Market. However, what should be done if the feature is optional... if it could be made to run on many…
Chad Schultz
  • 7,770
  • 6
  • 57
  • 96
42
votes
6 answers

Why has the READ_PHONE_STATE permission been added?

In the latest beta version I just published to the Play Store, I notice that the READ_PHONE_STATE has been added since the previous version. I haven't added this myself. All I can recall doing since the previous version is using v9.6.0 of various…
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
41
votes
6 answers

When do I need android.hardware.location.gps and android.hardware.location.network?

Google is informing by email of changes to the Android location permissions: We’re making a change on October 15th, 2016 that will affect apps targeting API version 21 (Android 5.0, Lollipop) or higher that use ACCESS_FINE_LOCATION but don't…
mattm
  • 5,851
  • 11
  • 47
  • 77
40
votes
8 answers

Ask permission for push notification

I'm working an application and I need to use push notification. I know that push notification are a normal permission so I can't ask it at run time. But I would insert in the permission when the user downloads and installs the application, and the…
Paul
  • 511
  • 1
  • 5
  • 7
40
votes
2 answers

Android permission.INTERACT_ACROSS_USERS denial

I've a strange android permission denial, here is it: java.lang.SecurityException: Permission Denial: isUserRunning() from pid=1078, uid=10284 requires android.permission.INTERACT_ACROSS_USERS I haven't found anything about…
Michele Lacorte
  • 5,323
  • 7
  • 32
  • 54
39
votes
2 answers

NameNotFoundException when calling getPackageInfo on Android 11

After setting targetSdkVersion to 30 (Android 11) I'm getting android.content.pm.PackageManager$NameNotFoundException when doing packageManager.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS) on packages that I know exists. The…
Roy Solberg
  • 18,133
  • 12
  • 49
  • 76