3 ms·
What about using the post-kitkat Storage Access Framework and adopting the user-granted permission to access removable storage? That is, once your user manuall
by fattire 10y ago
What about using the post-kitkat Storage Access Framework and adopting the user-granted permission to access removable storage? That is, once your user manually grants access to a file or directory (in android 7) using the file/directory picker built into Android, your app can keep that permission for later and use it whenever it wants.
http://developer.android.com/guide/topics/providers/document-provider.html http://developer.android.com/guide/topics/providers/document...
They also made a video explaining how it works:
https://www.youtube.com/watch?v=C28pvd2plBA https://www.youtube.com/watch?v=C28pvd2plBA
Info about scoped directory access in Android 7.0:
https://developer.android.com/training/articles/scoped-directory-access.html https://developer.android.com/training/articles/scoped-direc...
Incidentally I didn't see READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE in the list.
- digi_owl 10y agoI have some bad experiences with mediastorage (the core of SAF) getting the state of the FS royally confused. Various apps used that path even before SAF, because it is also the backend for the Media Transfer Protocol support. Thing is that SAF only arrived with 4.4, and didn't properly handle anything more than single file access until 5.0. The the write_media_storage permission was introduced in 3.1. Thats some 5 releases and 2 years of goofing around before they sorted their own mess. Oh and the external_storage permissions where there initially, but they seem to have edited it since in an effort to clear out some non-Android stuff.