开发者

Sorting Android Songs

New Android developer here; well versed in Java. I'm looking to create a playlist maker and am having trouble sorting my media. I'm following a tutorial but it does not cover how to sort the media by artist. I'd like to have a ListView of the artists and if you click an artist it expands down to show the albums by that artist, and then if you click an album it开发者_开发百科 expands down to show the songs in that album. Keeping future capabilities in mind, I'd like to be able to drag and drop albums/songs.

I appreciate any help you have to offer.


What you want to look into is the Android Media Store. http://developer.android.com/reference/android/provider/MediaStore.html

Using the managedQuery function in an activity you can get a cursor to the MediaStore database. There are levels of URI in mediastore Artist, Album, or songs. You can sort out the information you want using that library.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜