android-permissions

How can i Use External Storage in android

六月ゝ 毕业季﹏ 提交于 2019-12-29 09:14:28
问题 This is for the first time i am using external storage in android. I need some help how can i perform different operations such as how to check whether External Storage is available or not?, How to write files or pictures into storage . 回答1: how to check whether External Storage is available or not? Use Environment.getExternalStorageState() . How to write files or pictures into storage Use standard Java I/O, working off a directory built using Environment.getExternalStorageDirectory() . 回答2:

How can i Use External Storage in android

╄→гoц情女王★ 提交于 2019-12-29 09:14:13
问题 This is for the first time i am using external storage in android. I need some help how can i perform different operations such as how to check whether External Storage is available or not?, How to write files or pictures into storage . 回答1: how to check whether External Storage is available or not? Use Environment.getExternalStorageState() . How to write files or pictures into storage Use standard Java I/O, working off a directory built using Environment.getExternalStorageDirectory() . 回答2:

Android 6 Permission access to internet

我的未来我决定 提交于 2019-12-29 08:55:35
问题 month ago I wrote my first app and I put permission to write on sd-card, when activity start i request permission i do: if (permission != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("L'app richiede i permessi di scrittura") .setTitle("Richiesta Permessi"); builder.setPositiveButton("OK", new DialogInterface

Android onRequestPermissionsResult grantResults size > 1

北战南征 提交于 2019-12-29 07:05:10
问题 After requesting permission, the ActivityCompat.OnRequestPermissionsResultCallback sometimes contains multiple grantResults, is it safe to just check the first one? The training doc check the param like this: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // permission was granted, yay! Do the // contacts-related task you need to do. } else { // permission denied, boo! Disable the // functionality that depends on this permission. } but it's not clearly

Get Android system permissions by putting app in /system/app?

可紊 提交于 2019-12-29 05:27:07
问题 Experimenting with some newer Android APIs from the AOSP, I have found some that require the android.permission.BLUETOOTH_PRIVILEGED permission. According to the docs, the permission "is not available to third party applications." I have read elsewhere that you can get system level permissions on a rooted device by installing your app in the /system/app directory. I have tried this on my rooted Nexus 5, but my app still does not get the desired privilege. (See code and LogCat output below.)

Restricting Android Broadcast Receiver from specific app

岁酱吖の 提交于 2019-12-29 04:26:07
问题 I have 2 applications. If I use service, I can set permission so only app1 can send intent to app2 : Define permission in app2 ( protection level: signature ), and use that permission in app1 . Service in app2 is protected by that permission. In this way, only app1 can send an intent to a service on app2 , and no other app (unless my signature is leaked) can send intent to service on app2 . Can I do the same with Broadcast Receiver? app1: sendBroadcast(intent, permission) app2: define

Android Marshmallow Callback when user revokes permissions from settings ?

百般思念 提交于 2019-12-28 15:22:21
问题 Is there a way to get callbacks if the user revokes permissions from the settings after having granted them? I know we have to check for permissions before trying to use a camera etc etc. Consider the following scenario, I have a video processing application which needs permission to read and write to storage. The task of processing is usually in the order of seconds. Assuming the user gave permissions when asked and revokes them after the processing starts. In this case is there a way we can

Android Permission Request Code Issue

≯℡__Kan透↙ 提交于 2019-12-28 04:28:10
问题 How to request a Permission? I tried to documentation, but the constant int request code MY_PERMISSIONS_REQUEST_CALL_PHONE donst seem to just work, anything else to bear in mind for Backwards compatibility? ActivityCompat.requestPermissions(getApplicationContext(), new String[]{Manifest.permission.READ_CONTACTS}, MY_PERMISSIONS_REQUEST_CALL_PHONE); How to declare MY_PERMISSIONS_REQUEST_CALL_PHONE constant int? 回答1: For lower versions you need to declare permission in manifest only, but for

Boot BroadcastReceiver does not work on Xiaomi devices

不问归期 提交于 2019-12-28 04:06:34
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set

Boot BroadcastReceiver does not work on Xiaomi devices

十年热恋 提交于 2019-12-28 04:06:28
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set