安卓+获取艺术品 +谷歌音乐测试版
我正在尝试在将 mp3 与 Google Music Beta 同步的设备上获取这些艺术作品。因此,我尝试使用光标的标准方法来获取所有专辑 IDS,然后为每个专辑获取相应的艺术作品:
public void getAlbumIDS(){
Cursor cur = mContentResolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String [] {MediaStore.Audio.Media.ALBUM_ID}, null, null, null);
startManagingCursor(cur);
if (cur.getCount() > 0) {
while (cur.moveToNext()) {
int albumId = cur.getInt(cur.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
// Do stuff with albumId
}
}
cur.close();
stopManagingCursor(cur);
}
这样我应该获得与设备同步的专辑的所有 IDS,但 cur.getCount() 等于零。
我知道这是在设备中存储音乐时获取信息的正确方法(事实上在这种情况下一切正常),但我对检索与 Google Music Beta 同步的艺术作品感到很疯狂......
你能帮忙吗我?
I'm trying to get the artworks on a device that syncs mp3s with Google Music Beta. So I try the standard approach using a cursor to get all the album IDS and than for each of them the correspondent artwork:
public void getAlbumIDS(){
Cursor cur = mContentResolver.query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String [] {MediaStore.Audio.Media.ALBUM_ID}, null, null, null);
startManagingCursor(cur);
if (cur.getCount() > 0) {
while (cur.moveToNext()) {
int albumId = cur.getInt(cur.getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
// Do stuff with albumId
}
}
cur.close();
stopManagingCursor(cur);
}
with this I should get all the IDS of the albums synced with the device, but cur.getCount() is equal to zero.
I know that this is the right way to get info when music is stored in the device (in fact in that case everything works fine), but I'm getting crazy to retrieve artworks synced with Google Music Beta...
Could you please help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道是否可以从该应用程序之外的 Google Music Beta 访问歌曲或有关歌曲的信息。
比我更有知识的人可能能够提供解决方案,但我至少可以提供一些想法。即使有可能,我几乎肯定你现在尝试的方式不会起作用。
Music Beta 确实会下载歌曲并使其可供离线使用,但不会将它们存储在正常的音乐位置。如果是这样,那么其他音乐应用程序将索引这些歌曲并能够播放它们。事实并非如此,因此歌曲必须存储在其他地方。我尝试通过 SD 卡搜索来查找音乐,但没有成功。
仔细想想,这是有道理的,因为谷歌不希望其他人(例如亚马逊)开发的音乐播放器播放谷歌音乐测试版中的歌曲。
I don't know if it's possible to access songs or information about them from Google Music Beta outside of that app.
Someone more knowledgeable than I might be able to offer a solution, but I can at least offer some thoughts. Even if it's possible, I'm almost positive that the way you are trying to do it right now won't work.
Music Beta does download songs and make them available for use offline, but it doesn't store them in the normal location for music. If it did, then other music apps would index those songs and be able to play them. This is not the case, so the songs must be stored elsewhere. I've tried searching through the SD card to find the music but I haven't had any success.
This makes sense when you think about it, because Google doesn't want music players developed by others (Amazon for instance) to play songs from Google Music Beta.