In connection with your questions No. 1 and No. 2 ... Depending on which OS the device is used, there may be differences in behavior. Many permissions were changed / renamed / created when OS 4.7 was released. For example, here are the permissions I request for OS 4.5:
ApplicationPermissions.PERMISSION_FILE_API ApplicationPermissions.PERMISSION_INTER_PROCESS_COMMUNUCATION ApplicationPermissions.PERMISSION_CHANGE_DEVICE_SETTINGS ApplicationPermissions.PERMISSION_EXTERNAL_CONNECTIONS ApplicationPermissions.PERMISSION_INTERNAL_CONNECTIONS ApplicationPermissions.PERMISSION_WIFI ApplicationPermissions.PERMISSION_EMAIL ApplicationPermissions.PERMISSION_HANDHELD_KEYSTORE
And here are the permissions that I request for OS 4.7:
ApplicationPermissions.PERMISSION_FILE_API ApplicationPermissions.PERMISSION_CROSS_APPLICATION_COMMUNICATION ApplicationPermissions.PERMISSION_DEVICE_SETTINGS ApplicationPermissions.PERMISSION_INTERNET ApplicationPermissions.PERMISSION_SERVER_NETWORK ApplicationPermissions.PERMISSION_WIFI ApplicationPermissions.PERMISSION_EMAIL ApplicationPermissions.PERMISSION_SECURITY_DATA,
You can see that the number of rights has been renamed. You may need to update the code to find out about the OS and request specific permissions.
In question number 3, there is no way to execute any code during installation. The best thing you can do is make your AutoPlay on Startup application and run a check. However, this may be the worst solution, as the user may get confused by receiving a dialog box asking for permission at startup.
The best solution is to make sure that you have sufficient privileges every time you start the application. If not, request all the necessary privileges and process everything as gracefully as possible. If you complete this successfully, your users will only deal with permissions the first time your application is launched (until they talk to them later).
source share