Android MediaStore sqlite 数据库位置

发布于 2024-09-16 12:42:46 字数 174 浏览 3 评论 0原文

我正在尝试查找 MediaStore 使用的 sqlite 数据库。据我了解,MediaStore 包含默认音乐应用程序中定义的播放列表等。我实际上想复制播放列表,但应用程序不允许这样做。不知怎的,我想如果我能找到实际的数据库文件,我就可以解决这个问题。但我现在完全偏离了方向,因为我找不到数据库。顺便说一句,我正在运行 FroYo。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

清旖 2024-09-23 12:42:46

查看 Android 源类我们感兴趣的似乎是 android.provider.MediaStore ,其中 getDatabaseForUri() 方法似乎为每个外部存储卡生成不同的数据库一个名为 internal.db

所以我认为您感兴趣的文件是:

/data/data/com.android.providers.media/databases/internal.db

但是,我的该数据库副本没有 Java 源代码中使用的 audio_playlists 表,因此我不确定这是正确的。

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.

农村范ル 2024-09-23 12:42:46

正确的方法是使用内容提供程序查询媒体存储并对表格进行任何类型的修改那里。

如何查询 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 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);
万劫不复 2024-09-23 12:42:46

位置是:

/data/data/com.android.providers.media/databases/internal.db

audio_playlists 不在Tables中,您可以在Views中看到它。
sql工具是:sqliteman,ubuntu13.10

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

陪你搞怪i 2024-09-23 12:42:46

对于android 11(Rooted stock版本),

/data/data/com.android找到了数据库

我在这个位置/data/data/com.android.providers.media.module/databases/internal.db(对于系统相关文件)

。 providers.media.module/databases/external.db(用于用户相关文件)。

** 请注意将世界“模块”添加到 com.android.providers.media

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文