• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Accessing media files in arbitrary directories on external storage

Taqras

Lurker
Nov 15, 2021
3
3
I'm a bit of a newbie when it comes to Android development, and need a little guidance.

Media Files access is listed on Google Support as an invalid use case, that won't be allowed to have
MANAGE_EXTERNAL_STORAGE permission.

Instead, one should use the MediaStore API.
This seems to provide image metadata through MediaStore.Images.ImageColumns.

Also, it seems to me that the MediaStore API limited to files in quite specific directories, and the directory where the files are stored is not part of those metadata.

In my understanding then, this will be problematic if I want to access media files in other directories.

As an example: I store thousands of pictures taken with an SLR in custom directories on my SD card. And the underlying directory structure is related to the context in which the pictures were taken.

So my question is: Which mechanism should I use to access media files in arbitrary directories on an SD card?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones