The new Android 6.0 Run-Time permission model
The old security model was a sore point for many in Android. It's common to see reviews commenting on the permissions an app requires. Sometimes, permissions were out of the line (like a Flashlight app requiring internet permission), but other times, the developer had good reasons to request certain permissions. The main problem was that it was an all-or-nothing prospect.
This finally changed with the Android 6 Marshmallow (API 23) release. The new permission model still declares permissions in the manifest as before, but users have the option of selectively accepting or denying each permission. Users can even revoke a previously granted permission.
Although this is a welcome change for many; however, for a developer, it has the potential to break the code that was working before. We've talked about this permission change in the previous recipes, as it has far reaching implications. This recipe will put it all together to serve as a...