2

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?

NotDan
  • 31,709
  • 36
  • 116
  • 156

2 Answers2

11

Use the MediaStore content provider.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

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

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Leif Andersen
  • 21,580
  • 20
  • 67
  • 100