Ama*_*shi 12 android android-contentprovider
我正在尝试查询由"Google Play音乐"应用创建的播放列表,但尚未能够这样做.我使用本地存储的内容创建了一个播放列表.我使用以下代码来查询:
Cursor c = managedQuery(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,
new String[] {MediaStore.Audio.Playlists._ID,
MediaStore.Audio.Playlists.NAME
}, null, null, null);
Run Code Online (Sandbox Code Playgroud)
这适用于Winamp,但不适用于Google Play音乐.事实上,Winamp不会显示使用Google Play音乐创建的播放列表.但是,Google Play音乐会显示使用Winamp创建的播放列表.我的猜测是,Google Play音乐正在使用自己的数据库来存储播放列表,其他播放器使用内容提供商和uri MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI来存储播放列表.有没有办法让Google Play音乐创建播放列表?
jdg*_*day 14
我知道这个帖子已经老了,但我也一直在努力解决这个问题.
Google Play音乐会根据此非标准内容URI公开其播放列表
// list all playlists with their ID and Name
Cursor cursor = getContentResolver().query(
"content://com.google.android.music.MusicContent/playlists",
new String[] {"_id", "playlist_name" },
null, null, null);
Run Code Online (Sandbox Code Playgroud)
Google Play音乐内容提供商使用以下列名称
如果没有这个真正有用的应用内容提供商助手,我绝不会想到这一点
小智 0
\xc3\x8e 尝试查询 ContenProvider,就像启动 google Music 应用程序时在 Logcat 中看到的那样:
\n\ngetContentResolver().query(Uri.parse("content://com.google.android.music.MusicContent/playlists"), null, null, null, null);
\n\n但我没有得到结果:-(也许我做错了,之前与内容提供者没有太多合作,或者内容提供者可能对其他应用程序不公开。
\n| 归档时间: |
|
| 查看次数: |
5444 次 |
| 最近记录: |