Questions tagged [android-permissions]

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

3946 questions
21
votes
7 answers

Permission denied (missing INTERNET permission?): But permission is given

I'm trying to call a httpClient and the response is "Permission denied (missing INTERNET permission?)". In the normal browser of Android I can open the URL without problems. public static String getHttpResponse(URI uri) { StringBuilder response…
user1878413
  • 1,813
  • 4
  • 18
  • 24
20
votes
3 answers

Got "lacks permission android.permission.BLUETOOTH" on Specific device after android 12 update

So i have an application that connect to bluetooth printer. It is fine and running on all devices except these devices: Xiaomi redmi note 10 Pro (Updated to android 12 with MIUI 13.0.1) Oppo Reno 5 4G (model: CPH2159) (Updated to android 12 with…
Alkaaf
  • 265
  • 1
  • 2
  • 11
20
votes
4 answers

Download Manager Android Permissions error: write external Storage

I programmed an Android App that downloads a sample PDF file to the Download directory using DownloadManager. Here's the code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
20
votes
5 answers

Permission denied : opening provider com.google.android.apps.photos.contentprovider.MediaContentProvider that is not exported from uid

My app is crashing only in android >= 6.0 (marshmallow) when I try to access a photo URI stored previously in SharedPreferences. Though the image is retrieved for the first time without any error. I am using targetSdkVersion 22 so that I don't need…
20
votes
7 answers

Android System overlay window

I'm trying to create a system overlay. But I keep getting "permission denied". I'm using SDK version 23. My manifest file:
Tom
  • 472
  • 1
  • 6
  • 12
20
votes
6 answers

Android JobScheduler - can't create a persistent job

I am trying out the new JoScheduler API that has come with Android Lollipop. I have so far managed to successfully create and have a job run with a delay of 6000 milliseconds with no network requirements without an issue. However, I have just tried…
Richard Lewin
  • 1,870
  • 1
  • 19
  • 26
19
votes
2 answers

Is there a way to check for manifest permission from code?

How do I check for a specific permission in the manifest.xml from code? I want to throw some exception if some permissions that are necessay for my application are missing. For example, FINE_LOCATION and COARSE_LOCATION I know that android will…
rDroid
  • 4,875
  • 3
  • 25
  • 30
19
votes
0 answers

How can i get the caller phone number on android PIE without using read call log permission?

I've built a cool app that uses the outgoing/incoming phone number and send it some data. The phone number retrieval works fine in all android versions except android P (version 9). In that version i needed to add a READ_CALL_LOG permission in…
Idan ben shimon
  • 616
  • 5
  • 11
19
votes
3 answers

Permission Requests causes infinite loop in OnResume

In API >= 23, we are required to ask users for permission at run-time. But for some reason, the permissions are causing onResume to be called infinitely. What causes this? @Override protected void onResume() { super.onResume(); …
grantespo
  • 2,233
  • 2
  • 24
  • 62
19
votes
3 answers

How to open Draw Overlay permission popup in MIUI?

I want to open this permission popup in MIUI. I have tried this code, but this will not open permission manager popup for a particular app. public static Intent toPermissionManager(Context context, String packageName) { Intent intent = new…
Sagar
  • 585
  • 1
  • 9
  • 28
19
votes
3 answers

Do I need android.permission.WAKE_LOCK for Google Play Services if I only release in Google Play Store?

I am trying to integrate Google Analytics for Android. As per the documentation here, it asks to add android.permission.WAKE_LOCK (provides the comment note below). I dont understand it clearly. If I am releasing the app ONLY in the Google Play…
19
votes
2 answers

Android: write failed: EPIPE (Broken pipe) Error on write file

I was trying to take screenshot of the Android screen programatically. I had done the following code: private void getsnap(){ try{ Process sh = Runtime.getRuntime().exec("su", null, null); OutputStream os = sh.getOutputStream(); …
19
votes
1 answer

Few questions about custom permissions in Android

I am learning Android programming and I have kind of understood the concept of custom permission. Based on my understanding this is how custom permissions works: 'Base app'can protect some of its components (e.g., activity and services) by declaring…
18
votes
5 answers

Read and Write external storage permission isn't working

In my app i want to get user permission to read and write data on external storage, i have put permission tag in my manifest as below. But when installing app or running and where it requires to read or write to storage no permission is taken from…
saber javadi
  • 473
  • 1
  • 7
  • 17
18
votes
7 answers

Android revoke permission at start of each test

I'm using Espresso and UIAutomator to write my test cases. I'm testing external storage permissions when it's denied and when it's allowed. I have different test cases which all require the permission to be revoked at the start of the test…