суббота, 26 сентября 2015 г.
воскресенье, 6 сентября 2015 г.
Permission requests should be simple, transparent, and understandable. When requesting access, apps should ensure that either the feature itself or an explanation provided makes it clear why a permission is needed.
As great as this is, I’m sure that you’ve thought to yourself “that’s okay, I just won’t update to Marshmallow until I have to.” Updating your app isn’t as daunting as you might think, though. You simply need add a few lines of code that build in checks and graceful failures. So here’s a handy guide to walk you through it.
Step 1: check the platform. If the device is running Lollipop or earlier, then the user granted permission at install time, and you’re good to go. But if the device is running Marshmallow, you can’t be so certain. Clever developers can use the support library, though, which will do this check for you. That’s one less line of code for you to add.