1,144 questions
1
vote
0
answers
66
views
Issue with updating a file owned by MediaStore
On some of the MP3 files on my device (which is currently an emulator), I want to modify their ID3 data. The general approach I am using is:
copy the file from the Music folder (/storage/emulated/0/...
0
votes
0
answers
40
views
Get read permission for URI on android from playlist file without filepicker
My goal is to read a playlist (m3u) file and query/read the metadata for each file. However I'm kinda stuck on the permission part.
Just to be clear I do not want to open a filepicker for every single ...
1
vote
0
answers
82
views
How to load audio file thumbnails using Coil in android
I'm working on an Android app where I display a list of local audio files. Currently, I'm using ContentResolver.loadThumbnail() to get the thumbnails (album art) for these audio files, but this method ...
1
vote
0
answers
130
views
Google Photos Edit intent is limited for Media Uri only, why?
I'm trying to edit (Intent.ACTION_EDIT) app's media file from app's private folder in Google Photos,
but it seems Google Photos supports only Media Uri, and we can't get one for app's private storage, ...
0
votes
0
answers
155
views
Uri from Android's Photo Picker can't be opened or used in other apps
I'm trying to use Android Photo Picker to select a visual media (a photo or video):
val pickMedia = rememberLauncherForActivityResult(PickVisualMedia()) { uri ->
// use the returned Uri (upload ...
0
votes
1
answer
48
views
Kotlin MediaStore, how can I create an audio file in same folder as another scanned audio file?
I'm creating a music player app using android studio in kotlin. I'm using MediaStore to find audio files from MediaStore.Audio.Media.EXTERNAL_CONTENT_URI. I want to trim and save the trimmed version ...
0
votes
1
answer
94
views
How to read an image from a MediaStore URI for a file created by my app?
I have an application where I'm writing an image from a temp file/URI to the shared storage ('/storage/emulated/0/Pictures') using ContentResolver:
def addToMediaStore(): Uri? {
val filename = &...
0
votes
0
answers
65
views
How to query Buckets of content resolver with count (efficiently)
I'm trying to query all the buckets in external uri with their count from contentResolver.
I tried two approaches and both have big drawbacks.
Approach 1:
Use contentResolver's query API with bundles ...
0
votes
0
answers
57
views
Access database.csv in a download folder android 13+
i have an app that scan a nfc tag uid and check in a local database (in the downloads folder) if the uid is present and a the good time (between start date and end date written inside database.csv). ...
2
votes
0
answers
157
views
Correct way to launch camera via TakePicture contract and have the image saved in the Gallery
In my Android app, I need to let the user capture a photo using the camera for use by the app, but also ensure that the photo is saved into the device's shared gallery.
I am using the TakePicture ...
0
votes
2
answers
128
views
android studio AVD not showing the MediaStore.ACTION_PICK_IMAGES
This is my code
public static void ChooseVideo(ActivityResultLauncher<Intent> resultLauncher) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && SdkExtensions....
1
vote
0
answers
32
views
How to store Django media folder in different EC2 instance
I have to host Django project on multiple server for load balancing. I have 4 EC2 server. I have used first for Nginx setup, 2nd and 3rd for Django application host and host 4th server to store all ...
0
votes
1
answer
56
views
MediaStore.Images.Media.getBitmap(getActivity().getContentResolver() always rotates vertical image to horizontal
In my app, I'm just trying to select multiple images from gallary and show in recyclerview before uploading into server. In recyclerview, the images appear with original orientation. However before ...
0
votes
0
answers
120
views
Why is my code unable to find a file using MediaStore even though it exists in file storage?
I’m using MediaStore to store small pieces of data in file storage so the data persists even if the user uninstalls and reinstalls the app. My approach is to store the data alongside a local database. ...
1
vote
2
answers
431
views
How to Fetch List of Photos and Videos from Device Storage in Android Using Kotlin?
I'm developing an Android app in Kotlin, and I need to retrieve a list of photos and videos from the device storage. I’ve read that MediaStore can be used for this purpose, but I’m unsure how to set ...
0
votes
1
answer
118
views
How to trash an image which on SD card via MediaStore#createTrashRequest?
12/17 Update:
This is a bug, and it seems a fixed version will come out soon.
And also a workaround provide here for older version, see: https://issuetracker.google.com/issues/350540990#comment7
I'm ...
0
votes
1
answer
96
views
MediaStore contentResolver does not return anything when searching in EXTERNAL_CONTENT_URI
I'm working on an app and I'm trying to add functionality for searching (and playing) audio files. Right now I'm having an issue where the MediaStore contentResolver is not returning anything after ...
1
vote
0
answers
63
views
How to read others app's shared storage on Android 13+?
From android 13, we now need to access files that are outside of or app's sandbox using MediaStore or Safe Access Framework.
In my case I want to use files under '/storage/emulated/0/Android/media/com....
0
votes
0
answers
106
views
Android. How to save a file in a public directory of external storage correctly?
I want to save file in a public external storage. For this I use the following code:
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
However, starting with Android 10, ...
0
votes
1
answer
1k
views
How to access hidden media with MediaStore?
I'm developing a custom gallery app using MediaStore. I want to access all images and videos on device storage, including files which placed in hidden .folders.
My problem is that I don't understand ...
0
votes
0
answers
51
views
Android how to get an image from a mediastore made Uri? [duplicate]
I created and stored an image like this:
val values = ContentValues(2)
values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg")
values.put(MediaStore.Images.Media....
1
vote
1
answer
223
views
Permissions needed reading picture from gallery using MediaStore API
Consider implementing an app, that lets users pick images taken with a camera from Gallery, and then use those pics on the app.
Project settings are
targetSdk=34, compileSdk=34, minSdk=22
Using ...
0
votes
2
answers
47
views
Unable to get path file ( not media ) using Intent [duplicate]
I have this code where basically i got a file path ( not a media one ), for some reason, in some Android 10 devices I´m getting the path as
/document/msf:<number>
In the manifest I have
<...
0
votes
1
answer
393
views
CameraX ImageCapture invalid URI content
I have problems capturing image with CameraX, it outputs an image in the gallery which is corrupted and i get this error in the log which seems to point to error with the URI content:
E Couldn't ...
0
votes
2
answers
73
views
Can't save a mutableList into android mediaStore
I'm trying to save a mutableList into mediaStore, however I'm getting this error:
java.lang.IllegalArgumentException: Type not supported: interface java.util.List
at com.alclabs.waltv.MainActivity....
0
votes
0
answers
29
views
File Deleted from Physical Device but Receiving EEXIST Error
I have an app which creates a .zip file that contains .pdf and .jpgs. If the .zip file is deleted by the user on the physical device, it throws an error when the user goes to create another zip file ...
0
votes
0
answers
86
views
Android 12 MediaStore cannot read audio files from the SD card on a specific device
I am currently developing an MP3 player app, but I'm encountering a problem with reading music files from the SD card through MediaStore on a specific device. To verify if the SD card is recognized ...
0
votes
0
answers
41
views
Trouble Moving Photos to a Selected Folder Below API 29
Does anyone know why I cannot move my photo? Saving the photo to the selected folder works fine with MediaStore.Images.Media.RELATIVE_PATH, but how can I do it below API 29?
My code:
private fun ...
2
votes
0
answers
1k
views
SOLVED -- Saving an image from Photo Picker in app folder for permanent access
I have a database (SQLite) in which i want to store a path to an image.
I am using the PhotoPicker to get the image, I set it with "setImageURI()", this part works (the PhotoPicker is ...
0
votes
1
answer
105
views
Mediastore with cameraX does not overwrite saved photos
I wanted the photos to be overwritten, but instead (2), (3) etc. appear next to each photo
I tried setting a permanent save location, but it didn't work. This is the code i'm using to capture and save ...
0
votes
1
answer
519
views
MediaStore.getVolumeName(uri) - java.lang.IllegalArgumentException: Missing volume name
Using SAF I selected a folder for R/W media files.
For MediaStore.Audio.Media.getContentUri(volumeName) (29+ API) I need to specify a volume name (it can be a primary storage or external sd card) and ...
0
votes
1
answer
172
views
Access Files on a USB OTG device (SD Card reader) via MediaStore
Can I access the Images on a USB OTG device (SD card reader) connected to my Android device with MediaStore?
I am able to access the files using the Storage Access Framework with this code. I'm trying ...
0
votes
0
answers
105
views
ContentResolver.insert() creates audio file of "audio/aac" mime type with .aac extension instead of .m4a
The following codec creates audio file for AAC codec with .aac extension filename - audio.aac instead of audio.m4a:
val contentValues = ContentValues().apply {
put(MediaStore.Audio.Media....
0
votes
0
answers
109
views
On Android 11, after renaming media files on a removable micro-sd card, MediaStore can‘t be updated through the ContentResolver.update() method
On Android 11 (API30) and above, after renaming media files on a removable micro-sd card, MediaStore can‘t be updated through the ContentResolver.update() method. my targetSdkVison is 28.
I am not ...
-1
votes
1
answer
425
views
Android Storage(MediaStore)
i am trying to save the audio files from the cache to a music directory having a folder Voice Changer
the below code is working fine in android 10 and above
but below that its not working
I'm ...
0
votes
1
answer
366
views
How to WRITE to a file from native side (C/C++) on Android 13 Device
I have a complex image processing application that records images/videos using native code from C++ side, and would like to write to DCIM folder.
I've made this work with Scoped Storage on Android 10 ...
0
votes
0
answers
360
views
Trying to get MediaStore.Images.Media.EXTERNAL_CONTENT_URI to find image that I think is there; I am using MediaScannerConnection and it finds it
I'm trying to get a file to be recognized, which is to test my other code. Here is my code for finding the file and making sure the file is found:
String filePath = "/sdcard/Download/"+ ...
0
votes
2
answers
257
views
Android ImagePicker/MediaStore returns rotated image
I know this question has been asked many times but there is no best-case answer to be found.
MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri)
I am retrieving the bitmap from this ...
0
votes
0
answers
41
views
Android Passing a URI pointing to an image file to another activity not in the app module and deleting the file afterwards possible?
I'm trying to avoid TransactionTooLargeException by writing an image byteArray into a file created in
context.getExternalFilesDir(Environment.Directory_PICTURES), generating a URI from it, and passing ...
0
votes
0
answers
85
views
Album Id and Duration is 0 in Content Provider
I am trying to get audio files from user device content. All parameters such as name, artist or size match the found audio. But the album id and duration are equal to 0.
Moreover, if you somehow move ...
0
votes
1
answer
239
views
Store a PDF file in the public Downloads directory [compileSdk=32]
I have an url to download a pdf file as a byte array.
I have to store it in a public directory (e.g. Downloads), so it can be easily accessed by the user.
What is the simplest way?
I tried it with ...
0
votes
0
answers
143
views
Reading photos with Exif metadata
I am implementing a grid gallery in my Android app in which photos are sorted according to the photo's Exif metadata. All photos are read from a specific folder stored in Shared Storage at /DCIM or /...
0
votes
0
answers
137
views
I am unable to compress a file on all devices in java in android studio. It works on some android versions but not on all . Why?
I am unable to compress a file on all devices in java in android studio. It works on some android versions but not on all. I am uploading a profile picture in my application, but to upload large files ...
0
votes
1
answer
147
views
Empty image auto generated when using ActivityResultContracts.TakePicture(). Android Kotlin
I want to use system camera to take photos and save to external storage. Here is what I've done.
val dUri = if (Build.VERSION.SDK_INT > 28) {
MediaStore.Images.Media.getContentUri(...
0
votes
1
answer
64
views
Can I programmatically create an empty subdirectory under the shared media directory DCIM or the Download directory in Android?
My app needs targetSDK to be the latest 33, can't apply MANAGE_EXTERNAL_STORAGE permission, and also to work on Android 10 or newer phones with scoped storage enabled.
Neither the MediaStore API nor ...
0
votes
1
answer
291
views
How to replace non-owned file in Android 13?
I am working on application where I have to replace a file(image captured from camera) after editing it. Priorly I send request using Intent Sender to delete located at some URI and after that I save ...
1
vote
0
answers
74
views
Android `MediaStore` diacritic characters parsing issue
I'm experiencing strange issue with android MediaStore (I use android 13, LineageOS 20.0 distribution). I have my music library stored on computer in flac format and properly tagged fields artist, ...
1
vote
1
answer
255
views
MediaStore.MediaColumns.IS_FAVORITE Not Useable
Above Android 11. I can.t get valid value on this column from contentProvider, anyone has information? The follow is my code:
private static final String[] PROJECTION_30 = {
MediaStore....
0
votes
1
answer
398
views
Updating MediaStore.Audio.Media columns not working on API 30+ ( Android 11)
Issue:
Updating media files(audio) with Contentresolver.update(); not working on Android 11.
RecoverableSecurityException is thrown and i ask for permission to modify the content
Contentresolver....
0
votes
0
answers
91
views
Environment.DIRECTORY_RECORDINGS pointing to a non-existing folder
I am trying to write an Android audio recorder application. I will be using the MediaStore to store the recordings. I would presume that I should store them in the folder pointed to by the Environment....