Best Way To Retrieve Metadata From Mp3s In Android
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
Solution 1:
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.
Solution 2:
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,
newString[] {file.getCanonicalPath().toString()},
null);
This returns a cursor to the metadata of file
. (Author, Title, duration etc.)
Post a Comment for "Best Way To Retrieve Metadata From Mp3s In Android"