android-permissions

Android device not able to read phones state

和自甴很熟 提交于 2019-12-10 11:51:41
问题 In my code error occurs while reading phone's state. don't know why. here is my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.vspf"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /

multiple permissions in android:permisson

吃可爱长大的小学妹 提交于 2019-12-10 10:43:05
问题 I have a requirement to parse the AndroidManifest.xml of an app to find out what permissions a client app need to possess in order to communicate with this app. As per android developer guidelines the permission mentioned in the android:permission attribute of application tag and component (Activity, Service, Provider, Receiver) tag is supposed to be possessed by the client app. An example (AndroidManifest.xml excerpt) of this usage is <application android:permission="android.permission

App crashes with SecurityException on Android M [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-10 10:14:21
问题 This question already has answers here : Android 6.0 Permission Error (5 answers) Closed 4 years ago . Yesterday I set upped target and compile sdk to 23 API level. When I launched the app on Nexus 9 with Preview Android M (MPA441) the app crashes with following SecurityException : FATAL EXCEPTION: main Process: com.grouplogic.mobilecho, PID: 22554 java.lang.RuntimeException: Unable to create application com.mypackage.MyApplication: java.lang.SecurityException: getDeviceId: Neither user 10098

when I add android.permission.UPDATE_DEVICE_STATS to my app.error occur

北城余情 提交于 2019-12-10 10:03:04
问题 I developed an app which needs to get the android.permission.UPDATE_DEVICE_STATS permission. However, when I add this permission to my app's AndroidMainfest.xml file, I get this error: "Permission is only granted to system apps" What can I do to change my app to system app? Are there any other ways to solve this problem? 回答1: Most importantly to know: A system app can only be run by people who have rooted their device. Meaning you can't test and run your own application if you don't have a

get list of application which have internet permission in android

做~自己de王妃 提交于 2019-12-10 09:28:36
问题 I want to list of application which have internet access permission. I have this example PackageManager p = context.getPackageManager(); final List<PackageInfo> apps = p.getInstalledPackages(PackageManager.GET_PERMISSIONS); for (PackageInfo pkg : apps) { for (String permission : pkg.requestedPermissions) { // Check if permission is the internet permission } } but i am not getting this, how this code will check for internet permission? can someone give full example??? thank you. 回答1: This

Devices without “Apps using Usage Data” or android.settings.USAGE_ACCESS_SETTINGS intent

≯℡__Kan透↙ 提交于 2019-12-10 09:25:11
问题 Background: Android 5 introduced a new UsageStats API that can be used to query time spent with different apps. This API is used in several apps for detecting the current foreground app (as discussed in several questions, like this), but: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps. However, declaring the permission implies intention to use the API and the user of the device can grant

cordova - remove unnecessary permissions

痞子三分冷 提交于 2019-12-10 02:38:50
问题 I need to play sounds in my game, so I added org.apache.cordova.media plugin to my application. Now platforms/android/AndroidManifest.xml contains 2 entries I don't need: <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> If I remove those lines, this file regenerated and permissions are added again. What is correct way to remove these permissions? I use apache cordova 3.5.0 回答1: You have to open

Android 6.0 Write to external SD Card

爱⌒轻易说出口 提交于 2019-12-09 23:13:12
问题 I tried everything to write on external SD card on Android 6.0, but I am not able to write on it. I did research on stackoverflow and found lot of things but none works. Here is my code String extPath = System.getenv("SECONDARY_STORAGE") + "/Android/data/com.gvm.externalstorage.externalstoragetest/"; File file = new File(extPath,"myFiles"); if (!file.exists()) { boolean dirResult = file.mkdirs(); Log.e("Directory Exist", dirResult + " Directory created"); } else { Log.e("Directory Exist",

False positive lint permission error even after asking for permission at runtime

狂风中的少年 提交于 2019-12-09 16:37:54
问题 I am having hard time understanding runtime permission approach used by android. For those who are reading this, I am not asking here "how to call runtime permission".. i am able to show a permission dialog if it's not already been granted and even get it's result in onRequestPermissionsResult() in fragment. with this code if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { FragmentCompat.requestPermissions(this

Lacking privileges to access camera service in Android 6.0

元气小坏坏 提交于 2019-12-09 15:08:41
问题 I am using Camera2API in Android 6.0. I was done without error in Android 5.0. However, when I used my code in the Android 6.0, I have a issue. The issue is that sometime I can open the camera successfully and take picture. However, sometime the camera cannot open and it has error java.lang.SecurityException: Lacking privileges to access camera service at android.hardware.camera2.utils.CameraBinderDecorator.throwOnError(CameraBinderDecorator.java:108) I added the runtime permission as follows