Oct 18, 2017
Make Android Runtime Permissions easier with Dexter
In Android Marshmallow Google introduced new permissions system - now we request permissions in runtime. This approach is safer for the user, but for developers it is more code to write. We need to check if user willingly grants access and, if not, ask for it. Of course, old <uses-permission> in app manifest stays the same as before. Now there are two places serving nearly the same purpose. Next, call requestPermission() method (it’s required in our Activity class) and write callback with the results. Don’t forget about request code, same for defined methods! What if out app requires a really big amount of permissions? Activities can be overloaded with that logic and this causes a mess. Don’t worry - community comes with help.