I am trying to find the sqlite database used by the MediaStore. As far as I understand, the MediaStore contains amongst others the playlists defined in the default Music app. I actually would like to duplicate a playlist, but the app does not allow that. Somehow I thought I could fix this if I just could find the actual db file. But I got completely sidetracked now, because I just cannot find the db. Btw, I am running FroYo.
Having a look at the Android source the class we're interested in seems to be android.provider.MediaStore
and in there, the getDatabaseForUri()
method seems generate a different database for each external storage card and one called internal.db
.
So I think the file you're interested in is:
/data/data/com.android.providers.media/databases/internal.db
However, my copy of that database doesn't have the audio_playlists
table used in the Java source so I'm not certain this is right.
/data
is owned by root
so you're not going to be able to browse it with ASTRO on an unrooted phone. Try connecting your phone to your development PC and using adb shell
. I think this runs with root permissions on all phones but I don't have an unrooted phone with me to check this. –
Reta adb shell
and then run the su
command you should get root access. On an unrooted phone it seems only the root
and shell
users can use su
but I guess adb shell
runs as the shell
users so it should work. –
Reta The proper way to do this is to use the content provider to query media store and do any kind of modifications to the tables from there.
Quick example of how you would query all artists in the MediaStore.
String[] proj = { MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.DATA,
MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Artists.ARTIST };
//managed query doesn't need startManagingCursor called on the cursor
Cursor c = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
proj, null, null, null);
the location is:
/data/data/com.android.providers.media/databases/internal.db
audio_playlists not in Tables, you can see it in Views. sql tool is:sqliteman,ubuntu13.10
For android 11 (Rooted stock version)
i found the database on this location
/data/data/com.android.providers.media.module/databases/internal.db (for system related files)
/data/data/com.android.providers.media.module/databases/external.db (for user related files).
** Please note add the world "module" to com.android.providers.media
© 2022 - 2024 — McMap. All rights reserved.