Friday, 15 September 2017
Android READ_PHONE_STATE runtime permission asks to make and manage phone calls
Answer
Answer
In app I want to get unique phone id via TelephonyManager.getDeviceId(). To use this I need this permission READ_PHONE_STATE. Problem is with runtime permission on Android 6. In runtime permission popup dialogue, it asks to grant permission "To make and manage phone calls" which can scary users from using app. What can be done? Or can I get any other unique identifier for device without using such big permission?
TelephonyManager TM = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String deviceId = TM.getDeviceId();
Answer
I am using this as a unique device identifier in my app and i don't need any run time permission.
String android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
or You can use this
String uuid = UUID.randomUUID().toString();
Subscribe to:
Post Comments (Atom)
casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV
In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...
-
I'm using Simple HTML DOM to extract data from a HTML document, and I have a couple of issues that I need some help with. On the line th...
-
I've just started to learn CodeIgniter and gotten trouble with example below: My Controller: class Site extends CI_Controller ...
-
I am working with OpenSSL to try and get the SHA512 Hash function to work. When I am writing the code, Visual Studio's intellisense find...
No comments:
Post a Comment