4

I've been working on a small media player app for Android. I'm having some trouble retrieving the meta data from the music files. I've been using the MediaMetadataRetriever, but it has proved to be quite troublesome. Does anyone know of a better way to go about this? If so how would one implement such method?

RAS
  • 8,100
  • 16
  • 64
  • 86
Adam Jakiela
  • 2,188
  • 7
  • 30
  • 48

2 Answers2

2

I've used JAudioTagger, which you can find here. It supports (basically) every version of ID3, so you're covered even for old files with outdated metadata. Pretty good (and easy) solution. Other options include mp3agic and entagged.

Chris Cashwell
  • 22,308
  • 13
  • 63
  • 94
  • Thank you. I will explore these options. – Adam Jakiela Dec 17 '11 at 05:12
  • I tried using this library, but it seems the latest version is incompatible with Dalvik JVM. See http://stackoverflow.com/questions/6247862 and http://stackoverflow.com/questions/5488236 – NoBugs Aug 08 '12 at 08:36
0

I was able to read the metadata from the Android database, using the code here. Just change the managedquery to something like:

String selection = MediaStore.Audio.Media.DATA + " == ?";
cursor = this.managedQuery(media,
                        projection,
                        selection,
                        new String[] {file.getCanonicalPath().toString()},
                        null);

This returns a cursor to the metadata of file. (Author, Title, duration etc.)

NoBugs
  • 9,310
  • 13
  • 80
  • 146