Android Question Permissions in manifest not triggering question at install

Andrew Webb

Member
Licensed User
Longtime User
Hi All

I'm using the ContactUtils class here:
https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/

It allows to read contact info from a phone. I added these permissions to the manifest as per the tutorial for the class:

AddPermission("android.permission.READ_CONTACTS")
AddPermission("android.permission.WRITE_CONTACTS")

Initially the app failed on startup and I remember that the question 'Do you want to give permission to read / write contacts?' did not appear when the app installs.

I looked at the debug info and it said that permission was not granted for CONTACTS. I got the app working by manually checking the permission on the phone in the APP setting for this APP.

Does anybody know why the install is not triggering the permissions question? The phone is running android 6.
(Is it anything to do with the APP also being the assigned Administrator app on the device??)

Any help greatly appreciated...
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Andrew Webb

Member
Licensed User
Longtime User
Thanks Manfred, that's SOLVED it!

The last message on that thread contained a very useful code snippet for PERMISSION_READ_CONTACTS (and other phone permissions) that I was able to use.

In Summary...
In your code, call the CheckandRequest before any 'Dangerous' routines can run.
Also then wrap the 'Dangerous' code with the PermissionResult test.
 
Upvote 0
Top