PerracoLabs PerracoLabs - 2 years ago 171
Android Question

How to get absolute paths in the removable SD-card using Storage Access Framework (SAF)?

Is there any way to get the absolute path from specific Folders & Files located in the removable SD-card, using the Storage Access Framework (SAF)?


Answer Source

No, and even if you could, you would not be able to access them, unless they happened to be in one of the couple of locations on removable media for which you have read access (e.g., getExternalFilesDirs()).

The Storage Access Framework returns Uri values pointing to documents. Use ContentResolver and methods like openInputStream() to work with them. This is roughly equivalent to getting URL values pointing to documents and using an HTTP client to open a stream to work with the contents of those documents.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download