简体   繁体   中英

How to list all media in Android?

I'm building a specialized media player for android and need a way to select a song from the device. I like how the builtin music player groups everything by artist/album, is that something I would have to write or is there something I can just plug in to get that functionality for free?

What is the easiest way to list music files on the phone with some basic grouping by the idtag info?

使用MediaStore内容提供商。

You'll probably just have to write a method that scans the entire phone (or at least the music directory), for all of the media files that the phone can handle, and then store that data in a database yourself (using a content provider).

Either way though, you can find the source for the android Music app here:
https://android.googlesource.com/platform/packages/apps/Music

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM