runtime-permissions

Request Permission after selected option(either camera or gallery) from intent chooser in android

余生颓废 提交于 2019-12-03 23:12:29
I have created an intent chooser containing Gallery, Photos and Camera apps. Now for the devices running on Android 6.0 or greater I want to ask the run time permissions after app is selected from chooser like if user selects gallery option I will ask storage permission only and in case if user select camera option I will ask camera and storage both permissions if not given before. Can someone help me to do so? Here is my code public void openImageIntent() { File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); String timeStamp = new SimpleDateFormat(

confused about android runtime permissions

◇◆丶佛笑我妖孽 提交于 2019-12-02 06:11:03
问题 So this whole new android runtime permissions has gotten me confused. My app is currently compiling and targetting version 23 which means I have to use runtime permissions. My app primarily uses the camera api which needs the camera permission so I added the runtime permissions before opening the camera as such: if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {//ask permissions for camera ActivityCompat.requestPermissions(this, new

Can't turn on location on android api23?

五迷三道 提交于 2019-12-02 04:19:38
I have used the following code and the dialogue that asks for permission shows as expected. But when I click "allow" it doesn't do anything. The log message doesn't appear as if the permission wasn't granted so I went to my parameters to verify if location is "on" and it was "off". Wasn't it supposed to be on because I granted the app access to my location ? If I manually turn it "on" and then run the app again, once it asks for my permission, it works and shows the log message but isn't the whole point of asking for permissions (via dialogue) to turn on location (when it's off) if the user

confused about android runtime permissions

耗尽温柔 提交于 2019-12-02 01:08:39
So this whole new android runtime permissions has gotten me confused. My app is currently compiling and targetting version 23 which means I have to use runtime permissions. My app primarily uses the camera api which needs the camera permission so I added the runtime permissions before opening the camera as such: if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {//ask permissions for camera ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CameraPermissions); } else {//permissions attained now you can

Asking for permissions at run-time, Android M+

柔情痞子 提交于 2019-12-01 18:18:28
Firstly, I know this is a duplicate question, but I've been over the answers from other similar questions and haven't been able to find success with any of those solutions. I've developed an app which works perfectly on my testing device which is a Samsung S4 running Android L (5.0.1) however I would like for this app to also work on newer versions of Android. I understand that requesting permissions have changed for Android M+ so that they have to be asked at run-time, but when I try to implement this the dialog box never appears and hence the required permissions are never asked for. The

Android Marshmallow Location Permission handling

旧街凉风 提交于 2019-12-01 12:05:50
I am working on Android Marshmallow runtime permissions. I asked user for location permission, suppose he has allowed to get the location and i have started getting location but now user has denied the permission from settings of application. Now application has crashed. How can i handle it? Please help. This is worked for me !!! In Your Splash Activity of your application do the following, Note: If user disables the permission after some time, these piece of code will not allow to get into the application without any crashes, it asks a dialog to allow that needed permission. 1) Declare an int

check android process groups

元气小坏坏 提交于 2019-12-01 06:12:55
Device: android 6.0.1 I wrote an app, use WRITE_EXTERNAL_STORAGE permission in manifest, install this app, and then turn on storage permission for this app from settings. adb shell :/ # ps | grep com.amida.test u0_a199 6722 477 872572 41084 SyS_epoll_ b6c89c74 S com.amida.test :/ # cat /proc/6722/status Name: com.amida.test State: S (sleeping) Tgid: 6722 Ngid: 0 Pid: 6722 PPid: 477 TracerPid: 0 Uid: 10199 10199 10199 10199 Gid: 10199 10199 10199 10199 FDSize: 256 Groups: 9997 50199 Question: I think groups should has 1015. but can not find 1015 there, why? according to : #define AID_SDCARD_RW

check android process groups

百般思念 提交于 2019-12-01 04:11:12
问题 Device: android 6.0.1 I wrote an app, use WRITE_EXTERNAL_STORAGE permission in manifest, install this app, and then turn on storage permission for this app from settings. adb shell :/ # ps | grep com.amida.test u0_a199 6722 477 872572 41084 SyS_epoll_ b6c89c74 S com.amida.test :/ # cat /proc/6722/status Name: com.amida.test State: S (sleeping) Tgid: 6722 Ngid: 0 Pid: 6722 PPid: 477 TracerPid: 0 Uid: 10199 10199 10199 10199 Gid: 10199 10199 10199 10199 FDSize: 256 Groups: 9997 50199 Question:

How to ask permission to make phone call from Android from Android version Marshmallow onwards?

江枫思渺然 提交于 2019-11-30 17:51:16
I am trying to make a phone call from Android, and I've set run time permissions as well. And it asks whether to allow making phone calls. But when I press allow, the app crashes: This is how I implemented it: private static final int REQUEST_PHONE_CALL = 1; Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "+918511812660")); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(MainActivity.this, new

How to ask permission to make phone call from Android from Android version Marshmallow onwards?

孤人 提交于 2019-11-30 01:29:48
问题 I am trying to make a phone call from Android, and I've set run time permissions as well. And it asks whether to allow making phone calls. But when I press allow, the app crashes: This is how I implemented it: private static final int REQUEST_PHONE_CALL = 1; Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "+918511812660")); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE)