Code example for MediaMetadataRetriever

Methods: getEmbeddedPicture, setDataSource

      return true; 
  public static Bitmap getFileArt(String song_path) {
    MediaMetadataRetriever mmr = new MediaMetadataRetriever();
    byte[] image = mmr.getEmbeddedPicture();
    if (image == null) {
      return null; 
    } else { 
      return BitmapFactory.decodeByteArray(image, 0, image.length);
  /** Get album art for specified album. This method will not try to 
   * fall back to getting artwork directly from the file, nor will 
   * it attempt to repair the database. */ 
  public static Bitmap getArtworkQuick(Context context, long album_id, int w, int h, boolean preserveAspectRatio) {
    ContentResolver res = context.getContentResolver();