android-permissions

FileNotFoundException (permission denied) when trying to write file to sdcard in Android

本秂侑毒 提交于 2019-11-28 07:00:35
问题 As you can notice from title, I have a problem with writing file to sdcard in Android. I've checked this question but it didn't help me. I want to write file that will be in public space on sdcard so that any other app could read it. First, I check if sdcard is mounted: Environment.getExternalStorageState(); Then, I run this code: File baseDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); baseDir.mkdirs(); File file = new File(baseDir, "file.txt"); try {

MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION permission android not recognised in code

谁说胖子不能爱 提交于 2019-11-28 06:38:06
问题 We are currently trying to request GPS permissions from an android phone so that we can show the current location on a Google Map. We have included this manifest, outside of application tags, under the manifest tag: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> Here is the part of our code that is not working, it is not recognising MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION: if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE

Signing my android application as system app

橙三吉。 提交于 2019-11-28 06:04:48
Signing my android application as system app In my company, we would want total control for battery consumption in the field, using only 2g and gps could drain the battery awfully fast. What we decided is that we need to have root access to the mobile phone, So that when phone is idle, we would turn off those needless battery consumption. And also we would not allow users to uninstall it and clear data to it. My Question is : Where do I get these signature key? Is it going to like a root access If ever I successfully managed to sign it? What is the difference between Root vs Signed with key?

java.io.FileNotFoundException: /storage/emulated/0/New file.txt: open failed: EACCES (Permission denied)

柔情痞子 提交于 2019-11-28 05:53:20
I've been trying to encrypt files and write those files back on to the same place. But I got the error message saying "java.io.FileNotFoundException: /storage/emulated/0/New file.txt: open failed: EACCES (Permission denied)". My Manifest file is this <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.tdk.mytestapplication2"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <application android:allowBackup="true" I think I have provided correct permission

Application not able to access SD card when WRITE_EXTERNAL_STORAGE permission is granted at run time

ε祈祈猫儿з 提交于 2019-11-28 05:42:02
问题 In android M to access sdcard has to force stop and start app manually when permission is granted at runtime, how to achieve it programmatically? However sdcard can be accessed if the app is force stop and restarted. AndroidManifest.xml : uses-permission-sdk-m android:name="android.permission.WRITE_EXTERNAL_STORAGE /* **Checking permission ** if doesn't have request else browse file directory */ String[] perm = { Manifest.permission.WRITE_EXTERNAL_STORAGE }; if (checkSelfPermission(perm[0]) =

No activity found to handle intent action.dial

本小妞迷上赌 提交于 2019-11-28 02:29:18
问题 I'm trying to make my app call a number from an EditText, but I get: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL dat=Ring Tel nr. 123456789 } I've searched a while for an answer, but most of the answes are permissions and add activity to the Manifest. I've done both, if I'm not doing it wrong. And I'm running it on my phone, not the emulator. I've tried both with and without the intent-filters. Here are the codes: Manifest:

How to ask multiple permissions at same time in Android Marshmelllow

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 02:14:45
问题 Following code having multiple permissions, My error is when ever onclick button it asking only one permission, and again i click means it asking another permission. My Onclick public void onClick(View v) { getPermissionCamara(); getStroagePermission(); selectImage(); } My permissions are like this private static final int CAMERA_PERMISSIONS_REQUEST = 1; private static final int STROAGE_PERMISSIONS_REQUEST = 2; public void getPermissionCamara() { if (ContextCompat.checkSelfPermission(this,

Allowing microphone access(permission) in WebView [Android Studio] [Java]

∥☆過路亽.° 提交于 2019-11-28 02:08:55
I am currently working on a music tuner that uses html5 and a webview to display the 'application'. I've written the all the permission required in manifest and I think for webview there's another permission required. I am using this https://jbergknoff.github.io/guitar-tuner/ as a sample redirect page for now Here's my manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.raynordev.projectrosin"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission

Android READ_EXTERNAL_STORAGE permission not working

最后都变了- 提交于 2019-11-28 01:50:36
I'm trying to create a simple app that can get an image from the Gallery app and display it on an imageButton. I'm testing with API 21 on a phone running Android 5.0.1. Unfortunately, no matter what I try I keep getting a security error - even when I specify the permissions. My code for getting retrieving the image is: @Override protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent){ super.onActivityResult(requestCode, resultCode, imageReturnedIntent); switch(requestCode){ case PICK_IMAGE_REQUEST: if(resultCode == RESULT_OK && imageReturnedIntent != null &

How to find required Android Marshmallow runtime permissions in code?

我是研究僧i 提交于 2019-11-28 01:34:45
问题 I'm preparing my app to target Android 6.0 Marshmallow. When setting the target api to 23, the app immediately crashes upon launch. There is no useful information in the logcat output. (It gives a "Requested window does not exist" IllegalStateException, but still, nothing actually useful like class name or line number.) This is fine (not really), I eventually narrowed it down to my launch activity where I get the user's device IMEI code (TelephonyManager.getDeviceId()). There needs to be a