6

I'm wondering if it's possible to get Android permission dynamically without using AndroidManifest just with some codes, because I've some OSGi bundles running on Android and without Android permission they are restricted in functionality.


Thanks for your answers, yes it complicates the user experience and it's also dangerous for the user if that mechanism is provided

Cœur
  • 37,241
  • 25
  • 195
  • 267
Aghiles Adjaz
  • 61
  • 1
  • 2
  • 1
    thanks for your answers, i know that such a thing appears a little dangerous but if there is a mechanisme in Android to ask the user whenever a new permission is added so it's will be the same as what we have now with the AndroidManifest – Aghiles Adjaz Jan 31 '11 at 00:36

4 Answers4

6

No this is not possible.

You can't alter the contents of an already installed APK. It would be very dangerous to allow such a behavior anyway as the whole permissions system is meant to allow the user to first read what permissions an Application requires so he can judge if it is ok or not.

Octavian Helm
  • 39,405
  • 19
  • 98
  • 102
  • IPhone does this, should be there. In IPhone you can for example see all apps that has permission camera. You can then per app disable camera permission. – powder366 Feb 10 '15 at 22:35
4

No, sorry, you must request all permissions via the AndroidManifest.xml file.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
3

Yes, i found this line in http://developer.android.com/guide/topics/security/security.html:

Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.

diyism
  • 12,477
  • 5
  • 46
  • 46
1

Guys now from Android 6.0 Marshmellow onward, you can ask users at runtime to allow permissions dynamically, I found of it, have a look at this link. I hope it will help you getting idea. a good tutorial

Naveed Ahmad
  • 6,627
  • 2
  • 58
  • 83