Android examples for android.media:Song
get Song Name via MediaMetadataRetriever
import android.media.MediaMetadataRetriever; public class Main { public static String getSongName(String songPath) { MediaMetadataRetriever songRetriever = new MediaMetadataRetriever(); songRetriever.setDataSource(songPath); String songTitle = songRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE); String artist = songRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST); StringBuilder buf = new StringBuilder(); buf.append(artist);/*w w w . j a v a2s . c om*/ buf.append(" - "); buf.append(songTitle); // TODO make song title length enough depending on screen size if (buf.length() > 32) buf.replace(30, 31, ".."); return buf.toString(); } }