From the course: Android Development Essential Training: Manage Data with Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Manage permissions in a splash screen

Manage permissions in a splash screen

From the course: Android Development Essential Training: Manage Data with Kotlin

Start my 1-month free trial

Manage permissions in a splash screen

- Android distinguishes between internal and external file storage. The external storage area is visible to the user through a file manager app even if a file's location isn't immediately apparent. But just like internal files, they're deleted when the app is uninstalled. To write to external storage, you need a permission that the user has to grant at run-time on recent versions of Android. Writing to files in external storage is a so-called dangerous permission. And as with all such permissions, you can either ask for it as the app starts up, or only when it's needed. I like asking as the app starts up if it's a permission I know I'm going to need. And then I'll only let the user see the rest of the user interface once it's been granted. So that's how I'm going to build this app. I'm going to add a splash screen. It'll be its own fragment in my navigation path, and that's where I'll put all my code for managing the app's permissions. I'll go to my nav_graph.xml file. I'll click the…

Contents