I compiled the release version and tried to install it on several Meizu MX5 , Samsung S5 and OnePlus devices. Meizu MX5 , on the Meizu MX5 and Samsung S5 before installing the application, a form opens asking me to confirm the permissions listed.

When I upload the same file to OnePlus it does not ask anything, it immediately installs everything ...

What may it depend on?

  • from the version of androyd. - Android Android
  • under which version do all the phones on which work? - ZigZag
  • @AndroidAndroid 2 on which it is requested to work on 5.1, the one that does not request on 6.0 ... And how does it depend? Is this a new 6-ki feature? Now everything is requested dynamically? - Aleksey Timoshchenko
  • @ZigZag 2 which is requested to work on 5.1, the one that does not request on 6.0 ... And how does it depend? Is this a new 6-ki feature? Now everything is requested dynamically? - Aleksey Timoshchenko
  • Yes, it requests dynamically from version 6. If you put compileSdkVersion 22 , Then at 23 it will be the same as on the previous ones - Vladyslav Matviienko

2 answers 2

If the phone is running Android 6.0 (API level 23) or higher, and the application has targetSdkVersion 23 or higher, then the application requests permissions dynamically.

If the phone is running Android 5.1 (API level 22) or lower, OR the application has targetSdkVersion 22 or lower, then the application requests permissions during the installation.

  • I am familiar with this. My application works with the camera and I make such a dynamic request to the camera. But this is the only resolution that the application requests dynamically ... All other permissions (READ_PHONE_STATE WRITE_EXTERNAL_STORAGE GET_ACCOUNTS`) are not implemented dynamically, but the application still works differently ... - Aleksey Timoshchenko
  • which targetSdkVersion application? - ZigZag
  • It seems I figured out what was happening, I just can’t understand one thing, maybe you’ve come across this ... One of the dangerous permissions in my manifesto is WRITE_EXTERNAL_STORAGE and for persuasiveness I went to the settings of the phone, found my application and looked at the permissions and really off ... But in the process of work, the application writes everything perfectly into the device's memory ... Maybe this is because the device's memory does not belong to EXTERNAL_STORAGE ? But then why when I wrote the code that should save the data I needed to specify this permise ... it is not clear ... - Aleksey Timoshchenko
  • device memory does not refer to EXTERNAL_STORAGE. By EXTERNAL_STORAGE is a memory that can be removed from the phone at any time, such as a memory card. Nobody can "force" you to specify this perm, because you are the developer himself and he himself determines where your data should be stored. Data storage in EXTERNAL_STORAGE is not the best option, since application to them may lose access, but if it is permissible from the point of view of architecture, then why not .. - ZigZag

Dynamic permissions Android. Starting with version 6, the scheme for obtaining permissions has changed slightly. An article on Habré on this topic is https://habrahabr.ru/post/278945/

  • I am familiar with this. My application works with the camera and I make such a dynamic request to the camera. But this is the only resolution that the application requests dynamically ... All other permissions ( READ_PHONE_STATE WRITE_EXTERNAL_STORAGE GET_ACCOUNTS`) are not implemented dynamically, but the application still works differently ... - Aleksey Timoshchenko