android-permissions

Request permission on Android M only when targeting lower API

淺唱寂寞╮ 提交于 2019-12-07 04:10:31
问题 So in my app i would like to add an option to selectively add a permission (say, direct dial) when the user is on Android M but, at the same time, i would like to have that permission NOT showing as required in API 22 or lower simply because its not essential so i prefer not asking for it during install (so de facto making that feature available on M only). So, i understand the new model of M is that it will allow optional permissions when user is on M and it will make those permissions

Android launch app show “Can modify system settings” dialog

谁都会走 提交于 2019-12-07 01:15:33
问题 I write a simple demo , test a third-party push SDK. When I launch my demo , system shows me a dialog like this. But the dialog doesn't show up below Android 6.0 How to avoid it when I launch my app except allowing the permission request? 回答1: As per marshmallow and onwards,the app is not allowed the permissions at the time of installation. Rather, the system will ask for required permission at the time in need(only one time if granted).In older versions(<23), apps were granted all required

Run-time permission of Marshmallow

假装没事ソ 提交于 2019-12-06 21:24:01
问题 Such a new and awesome security functionality is RUN-TIME Permission I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle " Never ask Again " Suppose my application MUST need Location/contact but user DENY it with "NEVER ASK AGAIN". What can i do for that. Not all User understand my field is required. ANY SUGGESTION? 回答1: First you need to implement OnRequestPermissionsResultCallback

onCreate() gets called when reopen from recent task after permission settings is changed

点点圈 提交于 2019-12-06 20:46:12
问题 The question title may sounds complicated but here is my situation. I have a map fragment within an activity. Simple. turn on Storage permission to allow display of Map, works fine. Backgrounds the app by pressing Home button, then turn off the Storage permission and open the app from recent task, app crashes. The problem is instead of calling onResume() of the host Activity, onCreate() is called on the host Activity as well as onCreateView() of the Map fragment. Thus it is throwing

BroadcastReceiver permission for adb shell

限于喜欢 提交于 2019-12-06 17:43:49
问题 Consider a simple tool using a BroadcastReceiver to achieve a simple goal. Because this should not be used by other applications, it defines a permission with a protectionLevel of signature or signatureOrSystem : <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="any.test"> <permission android:name="any.test.PERMISSION" android:protectionLevel="signatureOrSystem" /> <application android:label="AnyTest"> <receiver android:name=".Receiver" android:exported="true"

Few questions about custom permissions in Android

烈酒焚心 提交于 2019-12-06 17:02:30
问题 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 custom permissions (i.e., using <permission> tags in the manifest file) and the 'client app' that calls the activities and services protected by custom permissions need to acquire necessary permissions (i.e., using <uses-permission> tags in the

Android - Mystery Permissions Appear in Build Manifest

非 Y 不嫁゛ 提交于 2019-12-06 16:54:10
问题 Recently when uploading my app to Google Play, there was a warning that new permissions had been added: I don't need these permissions. I found they may be coming from libraries that I'm using, so I removed all <uses-permission> from my AndroidManifest.xml to test this. 1. Merged Manifest Report I checked the merged manifest report in /app/build/outputs/logs/manifest-merger-debug-report.txt , and it showed me the following permissions were being added by various libraries: uses-permission

How to ask for user permissions in Android 6

为君一笑 提交于 2019-12-06 15:45:58
I am totally confused regarding the new permission system in Android 6 (Marshmallow). I am using two so called 'dangeorus permissions' - <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> And I use these permissions in many places. I need to access the user accounts for Registering the app, Sending Feedback etc.And I also access Device Id for registering the app. I wrote two functions to get the list of Mail Accounts and the device id in a Java Class named util, and uses these function in AsyncTask as well

Android issues reading images from persistent Uri

只愿长相守 提交于 2019-12-06 15:27:27
问题 My app lets the user select images and then it animates the images. It's a simple thing and I want it to run on 4.2 and onwards. It works perfectly now. The app is supposed to remember the chosen images and let these be default the next time the user runs the app - when the app is restarted. This works beautifully on my Galaxy Nexus (4.2.1) but not so well on my Galaxy S8+ (7.0). Since I love how it works on 4.2.1, it's a bit frustrating that it can't simply run the same on later platforms.

Uninstall an app programmatically

醉酒当歌 提交于 2019-12-06 12:31:51
I want to develop an open source app for uninstalling applications. How can I do this? And how can I uninstall an app that is in /system/app/ after I gain root access? Thanks You can execute adb commands from within your app if you have root access like this Process process = Runtime.getRuntime().exec("your command"); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream())); use try catch as well for this code After a little searching on the android developer website I found this package installer which facilitates the installation and removal