We have a AutoCompleteTextView which is able to read from the users-contact-data as a convenience. However some users complain about the "READ_CONTACT" Permission the App is enforcing at installation. Is there any Way to let the user Choose to grant this permission and use this feature, or deny it and loose the feature? If it is not possible at Runtime, maybe there is some other way? Building two Apps, one with that permission and one without is not an option!
2 Answers
Is there any Way to let the user Choose to grant this permission and use this feature, or deny it and loose the feature?
Unfortunately, no.
If it is not possible at Runtime, maybe there is some other way? Building two Apps, one with that permission and one without is not an option!
You can build a main app without that permission, then create a plugin that holds the permission and securely interacts with the main app. This is a bit of an advanced technique. I cover it in one of my books, and here is the directory with sample projects demonstrating the host and the plugin. In my case, I am using CallLog
instead of ContactsContract
, though the permission (READ_CONTACTS
) is the same.

- 986,068
- 189
- 2,389
- 2,491
-
@user370305: The plugin requests certain permissions (e.g., `READ_CONTACTS`) that are predefined. It is impossible to request permissions at runtime -- that leads to the Vista Syndrome ("the CPU would like to execute an instruction: allow? deny?"). However, the main application does not have to request the permission the plugin requests, which addresses the OP's user's concerns. – CommonsWare Jun 15 '12 at 12:27
-
Ya.. I got it in your project. Thanks.. +1 for sample project. – user370305 Jun 15 '12 at 12:28
I'm not too sure about this, but you could build a separate app, that requires this permission. This extra app provides a content provider. Your main app now checks if your extension app is installed and gets that data from the content provider.

- 42,195
- 18
- 124
- 148
-
Well, than the answer is no. Apart from that, my suggestion doesn't require the sceptical users to download a separate app. You can also host the extension app on a separate server and prompt the user to install it automatically if he wants that. All the user has to do is press ok on the installation screen. – Kirill Rakhman Jun 15 '12 at 12:23
-
??? very weired! QUOTE: "my suggestion doesn't require the sceptical users to download a separate app" vs " You can also host the extension app on a separate server". HOW the user should GET this app if not DOWNLOADING?? – Rafael T Jun 15 '12 at 12:50
-
He's just trying to help @rafael. For what it's worth, his suggestion of offering to download an extension app from a different server isn't bad at all - it could be a nice "in app" background process, I.e. No need to download 2 apps from the market – barry Jun 15 '12 at 12:59
-