[Solved] How to Grant Permissions without User Interaction?


In general you request permissions in your manifest file so that the user can agree when he installs the application.

However, there has been a change recently in Android 6.0 which requires that the user is asked at runtime if the permission is dangerous. The android.permission.CAMERA permission is on of those dangerous permissions. As noted by mmBs you could set your target API level to less than Android 6.0 (e.g. 21 = 5.0) to achieve backwards compatible behaviour. But I would recommend to always update the target API level to the latest platform.

Nevertheless, you can take photos by capturing the photo using an intent (https://developer.android.com/training/camera/photobasics.html). That way your app doesn’t need the CAMERA permission (the other app invoked by your intent does, but not yours).

solved How to Grant Permissions without User Interaction?