我想同步自己的数据库,曲目和专辑(包含额外的数据)。我至今成功地拉到专辑和曲目从MediaStore。
I am trying to synchronize my own database for tracks and albums (that contains additional data). I have so far successfully pulled albums and tracks from the MediaStore.
我不能管理做适当的拉流派的轨道。可能有人张贴一些code?我想,以避免查询数据库中的每个磁道,所以如果可能的一些code加载关联(Genre.id< - > Audio.id)将是巨大的。
What I cannot manage to do properly is to pull the Genres for the tracks. Could someone post some code? I'd like to avoid querying the database for each track, so if possible some code to load the association (Genre.id <-> Audio.id) would be great.
我很努力在正在使用的内容提供商,以获得Genres.Members信息。
What I am struggling on is using the content provider to get the Genres.Members info.
推荐答案我想看看ringdroid的优秀创作者如何做到这一点。 ringdroid.google$c$c/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java
I'd take a look at how the excellent creators of ringdroid do this. ringdroid.googlecode/svn-history/r37/trunk/src/com/ringdroid/SongMetadataReader.java
他们基本上是通过检索类型名称和ID,并利用这些,他们可以很容易地创建一个CONTENT_URI这仅检索歌曲符合这些类型的数据库开始。 但如果我是你,我会检查是否有未知或空类型或不是包含在他们的ID3标签不流派名称的文件
They basically start by retrieving the genres names and ids and using those they can easily create a content_uri that retrieves only songs in the database that matches those genres. But if I were you I would check whether there is an "unknown" or "empty" genre or not for the files that contain no Genre name in their id3 tag
更多推荐
获得有效的音频文件的流派,在MediaStore
发布评论