The MediaStore provider contains meta data for all available media on both internal and external storage devices.
Questions tagged [mediastore]
1126 questions
81
votes
6 answers
How to save an image in Android Q using MediaStore?
Here is a link to the new Android Q Scoped Storage.
According to this Android Developers Best Practices Blog, storing shared media files (which is my case) should be done using the MediaStore API.
Digging into the docs and I cannot find a relevant…

Android Admirer
- 2,310
- 2
- 17
- 38
58
votes
7 answers
Android: Picasso load image failed . how to show error message
I am trying to use the picasso library to loading the image store in the mediastore. When I called load(imageview, callback), the picasso call onFail instead of onSuccess. How do I know why the image was not loaded successfully?

LittleFunny
- 8,155
- 15
- 87
- 198
55
votes
4 answers
How can I refresh MediaStore on Android?
This started out as a general user question on Android forums. However it's become, by necessity, a programming question. Here's my problem.
Android has a service - MediaScanner - which runs in the background any time (I believe) the SD card is…

roryok
- 9,325
- 17
- 71
- 138
45
votes
6 answers
Get list of photo galleries on Android
I'm looking for:
A list of the existing photo gallery names (hopefully their top thumbnail as well)
The contents of the gallery (I can then load thumbnails and full size as needed)
How would I go about getting a list of the "Galleries" (don't know…

ima747
- 4,667
- 3
- 36
- 46
42
votes
6 answers
MediaStore.Images.Media.insertImage deprecated
I used to save images using MediaStore.Images.Media.insertImage but insertImage method is now deprecated. The docs say:
This method was deprecated in API level 29. inserting of images should
be performed using MediaColumns#IS_PENDING, which…

coroutineDispatcher
- 7,718
- 6
- 30
- 58
36
votes
1 answer
MediaStore - Uri to query all types of files (media and non-media)
In the class MediaStore.Files class, its mentioned that,
Media provider table containing an index of all files in the media storage, including non-media files.
I'm interested in querying for non-media files like PDF.
I'm using CursorLoader to…

Shyam Prasad Murarka
- 464
- 1
- 4
- 8
32
votes
4 answers
List all music in MediaStore with the PATHs
Ok so I've been working on this project for a few days now and most of my time has been working out how to list all the music on a device in a LIST VIEW or something else, I have searched for a few days now and this is killing me. I did get so close…

user1853951
- 321
- 1
- 3
- 3
27
votes
3 answers
Create/Copy File in Android Q using MediaStore
I am trying to find method which can handle create and copy of any file except Media files (Picture/Video/Audio) to copy from one place to other in internal storage in Android Q. In this I have my file created in my app folder and I want those to…

Panache
- 1,701
- 3
- 19
- 33
24
votes
4 answers
How to save an image in a subdirectory on android Q whilst remaining backwards compatible
I'm creating a simple image editor app and therefore need to load and save image files. I'd like the saved files to appear in the gallery in a separate album. From Android API 28 to 29, there have been drastic changes to what extent an app is able…

multimodcrafter
- 343
- 1
- 2
- 7
24
votes
5 answers
when take photo get - java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()
The Exception is:
file:// Uri exposed through ClipData.Item.getUri()
java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1618)
at…

Michael
- 395
- 1
- 2
- 8
24
votes
1 answer
Inserting a video into MediaStore
I'm trying to insert a video into the MediaStore, the same way it's possible to store an image using this method:
MediaStore.Images.Media.insertImage(getContentResolver(), imagePath, null, null)
Since there's no similar method on…

Juan Andrés Diana
- 2,215
- 3
- 25
- 36
23
votes
1 answer
Media scanner for secondary storage on Android Q
With the newer Android Q many things changed, especially with scoped storage and gradual deprecation of file:/// URIs. The problem is the lack of documentation on how to handle media files correctly on Android Q devices.
I have a media file (audio)…

fillobotto
- 3,698
- 5
- 34
- 58
22
votes
4 answers
How to get and set (change) ID3 tag (metadata) of audio files?
I am working to change ID3 tags, the metadata in audio files, such as:
Artist
Title
Album
etc.
And the core point,. that edited ID3 tags should be shown only into my app.

Chirag Shah
- 2,058
- 2
- 20
- 30
22
votes
1 answer
Android: Is EXTERNAL_CONTENT_URI enough for a photo gallery?
I'm playing around with Android's MediaStore classes and was attempting to create a very simple photo gallery app when I noticed there were two image content URIs: EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI. At first I thought it was referring to…

idunnololz
- 8,058
- 5
- 30
- 46
21
votes
5 answers
Android 10: How to delete MediaStore item and it's associated data on file system programmatically?
I am updating my app to use Scoped Storage feature introduced in Android 10.
My app works with MediaStore and displays images, videos and audio files and provides ability for user to delete item.
What I did earlier to delete file:
Got path from…

artman
- 632
- 2
- 7
- 16