android-permissions

Read/Write Removable SD Card (android emulator)

与世无争的帅哥 提交于 2019-12-14 02:20:25
问题 Every time I try to read the informations of SD Card (removable storage), I get android.system.ErrnoException: statvfs failed: EACCES (Permission denied) I added permissions in manifest file : <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> As minSdkVersion > 23 public static void verifyStoragePermissions(Activity activity) { // Check if we have write permission int permission =

java.io.IOException: open failed: EACCES (Permission denied) when writing file in API level 23

徘徊边缘 提交于 2019-12-13 18:49:09
问题 I'm trying to export my DB to a CSV file. I have applied the appropriate permission to the AndroidManifest.xml . I'm just wondering why I can't write/create the file in my (actual device) Nexus 5X API level 23 where the same code works in my emulator Nexus 7 API level 22. Is the permission not enough? Here's the code: private void writeCsv() { File fileDir = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(), File.separator + "Example");

StartActivity once user click Allow on Permission Screen

时光总嘲笑我的痴心妄想 提交于 2019-12-13 15:24:38
问题 My one activity need Location Permission and I wrote below code to get permission. But in this case user need to click twice to open activity if app does not have location permission initially. Can I make some change so that once user click allow on Permission screen, only then intent fires. int PERMISSION_ALL = 1; String[] PERMISSIONS = new String[0]; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { PERMISSIONS = new String[]{ Manifest.permission.ACCESS_FINE_LOCATION}; } if (

Workaround for Android 6.0 Permissions

天涯浪子 提交于 2019-12-13 09:29:32
问题 Is there any way to get around the new Android 6.0 Permissions system if you need to build your App for Android 6.0 and use it on a 6.0 Device? I ask because there are so many Apps in the App Store which are not asking for any permissions and that's kinda weird. For me that means there are two possibilities. They all are not compiling their apps for android 6.0 They are somehow getting around the new permissions system using android 6.0 So is there a way around? 回答1: Change your targetSDK to

Not able to set permission in Android 7.0.0

空扰寡人 提交于 2019-12-13 06:46:06
问题 Not able to set permission in Android 7.0.0. App launch sets Camera ,Location, storage ,calendar permissions which is not working in Android os ver >6. Please help. I tried below link example but no luck http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android Permissions section. Please advise 回答1: There is currently (Ti SDK 6.0.2.GA) a JIRA ticket and an open Github pull request about Nougat permissions. Might be worth following that ticket. 回答2: You need to add the permissions

how to declare user defined permissions in android

帅比萌擦擦* 提交于 2019-12-13 06:19:00
问题 In android we use system permission but how can I create a new permission in an application, to be used by other applications. 回答1: You can use the <permission> tag for that. This page clearly explains how you can do it. 来源: https://stackoverflow.com/questions/11771285/how-to-declare-user-defined-permissions-in-android

How 3rd party app obtains my custom defined service permission to start my service?

怎甘沉沦 提交于 2019-12-13 05:42:17
问题 Here is my manifest file with my background service declaration ...... <service android:name="com.example.MyService" android:process=":service" android:permission="android.permission.BIND_VPN_SERVICE"> <intent-filter> <action android:name="com.example.START_MY_SERVICE" /> </intent-filter> ...... What should a 3rd party app declare in its manifest which is interested in binding with my service ? Also how does the verification of the permission( or custom defined permission) happens in my app

Why Worldwind globe is not showing in simulator?

99封情书 提交于 2019-12-13 05:13:03
问题 Recently I have been struggling with showing worldwind globe on simulator. I have found that on running the app in device it shows exact round globe as expected but on simulator it shows following output. I am not able to understand why this is happening. Any workaround on this? I have already put internet and external storage permission in AndroidMenfiest.xml . <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.qq

java.io.FileNotFoundException: /sdcard/testwrite.txt: open failed: EACCES (Permission denied)

做~自己de王妃 提交于 2019-12-13 03:55:18
问题 Please Help. I am developing Android App. Here is the problem. I can't write a file at /sdcard. what is wrong? Developement tool: Android studio 3.5.2 Device: AVD Pixel 2 API 29 I coded Permission Request . I can write a file with old android device. Why I can't write with this device ? Please Help. Error Log E: Unknown bits set in runtime_flags: 0x8000 E: --> WRITE_EXTERNAL_STORAGE=true E: --> READ_EXTERNAL_STORAGE=true E: ====================================================================

Calling WifiManager.startLocalOnlyHotspot() throws SecurityException even after granting all required permissions on some devices

允我心安 提交于 2019-12-13 03:14:04
问题 I am working on a file sharing app. I need to turn on local only hotspot of a device programmatically by calling WifiManager.startLocalOnlyHotspot(). According to the android docs on this page - https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%2520android.os.Handler), Applications need to have the following permissions to start LocalOnlyHotspot: Manifest.permission.CHANGE_WIFI_STATE and ACCESS