MediaStore API
Also known as: android mediastore api, Android MediaStore, media content provider, MediaStore.Images
MediaStore is Android's system content provider that indexes shared media (images, video, audio, downloads) across the device. Apps query it via ContentResolver to list photos and metadata without raw file access, which is the standard way under scoped storage.
- A system ContentProvider indexing shared images, video, audio, and downloads.
- It is the primary media path under scoped storage from Android 10 onward.
- Reads need READ_MEDIA_IMAGES/VIDEO (API 33+); deletes use createDeleteRequest().
What the MediaStore is
MediaStore is a platform ContentProvider backed by a media index that the system maintains over the shared storage volumes. It exposes collections such as MediaStore.Images, MediaStore.Video, MediaStore.Audio, and (since Android 10) MediaStore.Downloads, each addressable by a content URI like content://media/external/images/media.
Each row carries columns including _ID, DISPLAY_NAME, SIZE, DATE_ADDED, DATE_TAKEN, MIME_TYPE, WIDTH/HEIGHT, and RELATIVE_PATH. From a row's content URI you can fetch the bitmap, request a thumbnail with ContentResolver.loadThumbnail(), or open the file with openFileDescriptor().
MediaStore under scoped storage
Since Android 10 (API 29) scoped storage made MediaStore the primary path to shared media, since apps can no longer freely walk the filesystem. With the READ_MEDIA_IMAGES / READ_MEDIA_VIDEO permissions (Android 13+) or the legacy READ_EXTERNAL_STORAGE, an app can read media it did not create; writing or deleting another app's media generally requires a user-confirmed MediaStore.createDeleteRequest() or edit/trash request.
Android 14 added the partial Selected Photos access tier, where the user grants only specific items. MediaStore handles the heavy lifting of indexing, EXIF, and thumbnails, so apps avoid maintaining their own filesystem scan.
Why it matters for a photo cleaner
A duplicate and similar-photo cleaner like Cleanor enumerates the library through MediaStore: it queries MediaStore.Images for IDs, sizes, dimensions, and dates, loads thumbnails for fast on-device comparison, and groups likely duplicates. This is efficient and respects scoped storage because no raw file paths are needed.
When the user chooses to delete, the app routes removals through MediaStore's delete request flow so the system shows the standard confirmation, keeping the operation safe and policy-compliant.