android-permissions

Enable communication between two Android apps via custom permissions

╄→гoц情女王★ 提交于 2019-12-12 11:28:04
问题 One of my Android applications needs some features that are "dangerous" when it comes to permissions. They require some permissions such as "Internet access" which are critical in combination with private data. This is why I want to create a separate "Add-on", i.e. a second app that provides these permission-critical features. So if users want them, they can install the add-on, but the main app will still work without those permissions. Using a sharedUserId would obviously be the easiest

Given a permission name, how do I find the PermissionGroup?

青春壹個敷衍的年華 提交于 2019-12-12 11:20:01
问题 I want to look up the permission group for a permission at runtime (to provide guidance in the UI about how to visit Settings and then enable the permission, after the user has checked the "never ask again" button on the prompt). So I need the human-readable name for the permission group, but all I have is the machine-readable fully qualified permission string ( Manifest.permission.READ_PHONE_STATE ). Is there a way to do this? 回答1: getPermissionInfo() on PackageManager returns a

Request permission for microphone on Android M

那年仲夏 提交于 2019-12-12 11:14:07
问题 I need to utilize the microphone with Android M. I've tried setting up a permission group in the manifest, and can't get it working properly. Here's what I've got in the manifest: <permission-group android:name="android.permission-group.MICROPHONE" android:label="label" android:icon="@mipmap/day_icon" android:priority="360"/> <permission android:name="android.permission.MICROPHONE" android:permissionGroup="android.permission-group.MICROPHONE" android:protectionLevel="dangerous" android:label=

Secure.getString(mContext.getContentResolver(), “bluetooth_address”) return null in Android O

谁都会走 提交于 2019-12-12 10:45:24
问题 When I'm trying to get Blutooth Address on Android O device by this way: private String getBlutoothAddress(Context mContext){ // Check version API Android BluetoothAdapter myBluetoothAdapter; String macAddress; int currentApiVersion = android.os.Build.VERSION.SDK_INT; if (currentApiVersion >= android.os.Build.VERSION_CODES.M) { macAddress = Settings.Secure.getString(mContext.getContentResolver(), "bluetooth_address"); } else { // Do this for phones running an SDK before lollipop macAddress =

Which permission do we need at runtime in android 6.0

帅比萌擦擦* 提交于 2019-12-12 09:44:54
问题 I have an android code which can work well on Android 5.0 version. My AndroidManifest.xml is <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BROADCAST_STICKY" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission

Getting W/Activity: Can request only one set of permissions at a time

这一生的挚爱 提交于 2019-12-12 08:35:26
问题 I made an app that have a request for camera and GPS, but when I execute I am getting this warning several times with less than 1 second of each other. W/Activity: Can reqeust only one set of permissions at a time) Can some one tell me why? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); mStatusCamera = intent.getStringExtra("camera"); mScannerView = new ZXingScannerView(this) { @Override protected IViewFinder

how to make an incoming call from our application [duplicate]

人盡茶涼 提交于 2019-12-12 07:05:15
问题 This question already has answers here : How to send fake call broadcast on android (2 answers) Closed 5 years ago . i am trying to make an incoming call from a number given by me. in short i want to make fake incoming call . as i am new so i am not understanding how to complete this task. i have created incomingCallReceiver class where i am listening state of phone call. inside my activity class i am calling incomingCallReceiver class. this is my IncommingCallReceiver public class

Android marshmallow request permission?

耗尽温柔 提交于 2019-12-12 05:24:39
问题 I am currently working on an application that requires several "dangerous" permissions. So I tried adding "ask for permission" as required in Android Marshmallow(API Level 23), but couldn't find how to do it. How can I ask for permission using new permission model in my app? 回答1: Open a Dialog using the code below: ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 1); Get the Activity result as below: @Override public void

Get Path of Gallery Image Xamarin?

冷暖自知 提交于 2019-12-12 04:54:42
问题 I am trying to get the path of Gallery Image. I am getting the path of the image which is stored in internal storage but not of the external storage. I have also enabled the read-write storage and camera access permissions which has been granted. Here is my code void ChoosePhoto() { try { var imageIntent = new Intent(); imageIntent.SetType("image/*"); imageIntent.SetAction(Intent.ActionGetContent); StartActivityForResult(Intent.CreateChooser(imageIntent, "Select photo"), 0); } catch

Getting a Permission denied error when creating a file with Android, even when permission is given

人盡茶涼 提交于 2019-12-12 04:32:04
问题 I have this in my manifest: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> This is where I am trying to create and write to a file (it is in a file called EnterUserInfo.java : // Storage Permissions private static final int REQUEST_EXTERNAL_STORAGE = 1; private static String[] PERMISSIONS_STORAGE = { Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE };