android-permissions

java.io.filenotfoundexception open failed eacces (permission denied) on device

泄露秘密 提交于 2020-01-09 19:03:47
问题 The following code which consists of downloading a file from a server and save it in the storage works fine when the device has an internal storage. But when I tried it with a device with no internal storage, only with external storage I get the following exception. java.io.filenotfoundexception open failed eacces (permission denied) public void downloadFile(String dlUrl, String dlName) { int count; HttpURLConnection con = null; InputStream is = null; FileOutputStream fos = null; try { URL

Why has the READ_PHONE_STATE permission been added?

♀尐吖头ヾ 提交于 2020-01-09 07:13:48
问题 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 play-services libraries (was v9.4.0): compile 'com.google.android.gms:play-services-location:9.6.0' compile 'com.google.android.gms:play-services-places:9.6.0' compile 'com.google.android.gms:play-services-auth:9.6.0' Would this have done it? I can't

Android M Camera Intent + permission bug?

此生再无相见时 提交于 2020-01-08 13:56:13
问题 I'm trying to get my app ready for the new Android M permissions changes and found some weird behaviour. My app uses the Camera intent mechanism to allow the user to get a picture form the camera. But in another activity needs to make use of the camera itself with Camera permission (because of a library dependency card.io that requires this). However with M in the activity that only needs a camera intent when I try to launch the Camera intent I see the following crash (this does not happen if

Android M Camera Intent + permission bug?

我怕爱的太早我们不能终老 提交于 2020-01-08 13:56:03
问题 I'm trying to get my app ready for the new Android M permissions changes and found some weird behaviour. My app uses the Camera intent mechanism to allow the user to get a picture form the camera. But in another activity needs to make use of the camera itself with Camera permission (because of a library dependency card.io that requires this). However with M in the activity that only needs a camera intent when I try to launch the Camera intent I see the following crash (this does not happen if

How to Request Location permission before showing map set up in Xaml. Xamarin.Forms

爷,独闯天下 提交于 2020-01-06 17:26:29
问题 I recently updated sdk level to 6.0 in Xamarin.forms. I used Xaml to place a map on a page. Since I updated to 6.0 permission is required to show the map. My problem now is I can't figure out how to request permission to show the map before the app attempts to show it. As a result I get an unhandled exception. public MapPage() { Init(); InitializeComponent(); azureService = AzureService.defaultManager; } private async Task Init() { await RequestLocationPermission(); } protected async override

Cordova Android app crashes on Android P due to RECEIVE_SMS permission denial

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 05:30:11
问题 I have a Cordova Android app which works fine on earlier versions of Android OS, but app starts to crash on Android P (9.0), and I am getting the following logs while app launches: Permission Denial: receiving Intent { act=android.provider.Telephony.SMS_RECEIVED flg=0x19000010 (has extras) } to com.example.myapp requires android.permission.RECEIVE_SMS due to sender com.android.phone My app is retrieving SMS for OTP autocomplete and i already added RECEIVE_SMS permission to config file. It

java.io.FileNotFoundException: (Permission denied) Only in Oreo

爱⌒轻易说出口 提交于 2020-01-06 05:25:10
问题 I am downloading photos to smartphone. For versions lower than Oreo, there's no problem. But for Oreo, my code isn't not working. I tried this code in Emulator: I implemented a function to save an image to external storage. private void saveImageToExternalStorage(Bitmap finalBitmap,String name) { String root = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).toString(); File myDir = new File(root + "/xx"); myDir.mkdirs(); String fname = name + ".jpg"; File file =

Android API 26 SecurityException issue

◇◆丶佛笑我妖孽 提交于 2020-01-06 04:52:04
问题 In my app I have a fragment and an imageButton inside of this fragment. When I run the app in my device (Android 8 - API 26) and click imageButton, the app crashes and throws a runtime error which I didn't see before. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.mustafa.diyetisyenadmin, PID: 26366 java.lang.SecurityException: Permission Denial: null asks to run as user 1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android

Customize android app permissions description content

馋奶兔 提交于 2020-01-05 14:04:42
问题 Is there a way to describe about each permission in our own words in an android app ? For ex. if i'm requesting a "access-GPS" permission, can i put my own words in the description area inside the permissions dialog ? 回答1: This is not possible - would be nice sometimes to add something ( e.g. why you want this particular permission ) but replacing the description is a security problem 来源: https://stackoverflow.com/questions/29364539/customize-android-app-permissions-description-content

AOSP: How to restrict app accessing Camera, Location?

别来无恙 提交于 2020-01-05 12:29:29
问题 I'm trying to restrict apps in Android by modifying source code. I was able to get it working for Internet, but I was not able to restrict apps from using Camera or Location? Internet permission is enforced at linux process level with group-id. But I Camera/Location are not enforced the same way. So I want to know what is the best place to restrict the apps for these permissions. Are checkCallingPermission() enforceCallingPermission() methods the right ones? 回答1: Yes, you're right. In these