Questions tagged [android-permissions]

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

3946 questions
39
votes
3 answers

How can I customize the permission dialog in Android?

Suppose I request a permission at runtime like the following: ActivityCompat.requestPermissions( thisActivity, new String[]{Manifest.permission.READ_CONTACTS, MY_PERMISSIONS_REQUEST_READ_CONTACTS} ); The Android system creates a popup…
39
votes
8 answers

Calling DialogFragment's show() from within onRequestPermissionsResult() causes IllegalStateException in Marshmallow

Steps: Request a permission from Fragment or Activity Show a DialogFragment from within onRequestPermissionsResult() java.lang.IllegalStateException is thrown: Can not perform this action after onSaveInstanceState This doesn't happen when I show…
38
votes
3 answers

Android 11 users can’t grant background location permission?

As of Android 11, apps targeting SDK 30+ will not show a user an option to grant background location permission to an app more than once. If not initially granted, it requires users to go to a settings page. How do we bring a user to the proper…
davidgyoung
  • 63,876
  • 14
  • 121
  • 204
38
votes
2 answers

Request Location Permissions from a service Android M

I am using a service that on boot starts up and begins to check for location updates. Once i deny location access on permission popup now thanks to Android M my service crashes once the phone boots up. Since i have no activity in this case the call…
stud91
  • 1,854
  • 6
  • 31
  • 56
37
votes
3 answers

What's the difference between ACCESS_NETWORK_STATE and INTERNET?

What's the difference between ACCESS_NETWORK_STATE and INTERNET? If I use INTERNET, is it necessary to use ACCESS_NETWORK_STATE? In other words, can I use INTERNET without using ACCESS_NETWORK_STATE?
Alexandre Khoury
  • 3,896
  • 5
  • 37
  • 58
36
votes
4 answers

Permission denied in Android Emulator Device File Explorer

I want to check if a folder has been created in the External Storage. I already added permissions inside the AndroidManifest.xml:
36
votes
3 answers

How to detect Bluetooth state change using a broadcast receiver?

I am trying to make an app that shows a toast when the device's Bluetooth turned on. I wanna do that even when my app is not running. So I should use a broadcast receiver, add some permissions, an intent-filter to android manifest and make a java…
Mohammad H
  • 785
  • 2
  • 10
  • 25
33
votes
8 answers

Android manifest POST_NOTIFICATIONS missing import

Trying to implement the notification permission for android 13 or "Tiramisu" but failed to get the import for that permission. Currently: targeted SDK version is 32 compile SDK version is 32 I've declared it also in manifiest as below: …
Ammar
  • 765
  • 1
  • 8
  • 18
33
votes
6 answers

How to programmatically enable auto start and floating window permissions

How can I enable auto-start permission programmatically? How to find which phone need to do auto-start code? How to check if the auto start permission is enable or disable? I am able to find only about Display popup permission with…
Sagar
  • 5,273
  • 4
  • 37
  • 50
33
votes
4 answers

Checking if permissions have been granted already by user in Android

I have defined all the dangerous permissions in a String array as below: String[] perms = {Manifest.permission.READ_CONTACTS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.CALL_PHONE, …
Varun Rao
  • 453
  • 2
  • 5
  • 9
33
votes
6 answers

How to access the camera from within a Webview?

In my android app, I am trying to load a webpage (that must access the camera) on WebView. On my laptop, when I load the webpage, I could access the camera. Everything else on the html page is shown. Here are the permission I am putting in the…
McLan
  • 2,552
  • 9
  • 51
  • 85
33
votes
5 answers

Wait for user permission

I building an application that sampling GPS on starting. As you probably know, permissions are requested during run-time from Android M and above. So, in my case I'm starting with checking if permissions are needed, like this: private void…
AsfK
  • 3,328
  • 4
  • 36
  • 73
32
votes
6 answers

How to fix "Issue: Violation of Families Policy Requirements"

I've tried to publish an app on Play store but it's rejected and I've received an email titled: "Issue: Violation of Families Policy Requirements" And it also followed by: "Apps that contain elements that appeal to children must comply with all…
Yousef
  • 385
  • 1
  • 4
  • 11
32
votes
10 answers

How can I use adb to grant permission without root?

Background I'm trying to create an app that can grant and revoke permissions of other apps. To do this I'm using adb commands: pm grant packageName permissionName This works great if I call it through a shell with root permissions. Problem The…
Stefano Siano
  • 569
  • 1
  • 4
  • 13
31
votes
4 answers

WebRTC error inside Chromium WebView: "CheckMediaAccessPermission: Not supported"

I'm trying to show WebRTC chat in WebView. According to this documentation, WebView v36 supports WebRTC. For my test I'm using a device with Chrome/39.0.0.0 and I have added permissions to the AndroidManifest.xml file: