Android SD Card Write Permission using SAF (Storage Access Framework)

Letting the user choose the “SD card” or even the “Internal storage” SAF root give your application access to the corresponding storage, but only through the SAF API, not directly via the filesystem. For example you code could be translated into something like : public void writeFile(DocumentFile pickedDir) { try { DocumentFile file = pickedDir.createFile(“image/jpeg”, … Read more

How to use the new SD card access API presented for Android 5.0 (Lollipop)?

Lots of good questions, let’s dig in. 🙂 How do you use it? Here’s a great tutorial for interacting with the Storage Access Framework in KitKat: https://developer.android.com/guide/topics/providers/document-provider.html#client Interacting with the new APIs in Lollipop is very similar. To prompt the user to pick a directory tree, you can launch an intent like this: Intent intent … Read more