October 2018
Intermediate to advanced
464 pages
15h 17m
English
You probably noticed the checkStoragePermission() function from step 5 wasn't mentioned. This is because permissions aren't specific to storage but are required for the app to access various device features. Unlike the previous recipe, which used local app storage, "external" storage is considered risky for the user. (It wouldn't be good if just any app could go through a user's private files.) For that reason, the app must make additional effort to check if it has the required permission to access storage. If it does not, the user will be prompted. Note that this additional dialog is coming from the OS, not the app itself.
When you first run the app, if you are prompted for permission but still get an error writing, exit ...