Android Scope Storage Read File via Uri

January 30, 2020

Assuming you have the media/file uri based on MediaStore.MediaColumns._ID.

context.contentResolver.openInputStream(uri)?.use { inputStream ->

}

or

ontext.contentResolver.openFileDescriptor(uri, "r").use { pfd ->

}

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.