title: How to get album image of a song in android?
body: <p>Hy Friends.
  I want to get album image of songs. But I don't know how to get it.
  Please Help me.</p>
  
  <p>This is my code where I retrieve all the songs title and duration of songs from my sd card.</p>
  
  <pre><code>public List&lt;SongDetails&gt; getSongList(Context context)
  {
      ContentResolver musicResolver = context.getContentResolver();
      Uri musicUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
  
      Cursor musicCursor = musicResolver.query(musicUri , null , null , null , null);
      songDetailsList = new ArrayList&lt;&gt;();
  
      if(musicCursor != null &amp;&amp; musicCursor.moveToFirst())
      {
          do
          {
              SongDetails songDetails = new SongDetails();
              songDetails.setSongTitle(musicCursor.getString(musicCursor.getColumnIndex(MediaStore.Audio.Media.TITLE)));
  
              String songDuration = musicCursor.getString(musicCursor.getColumnIndex(MediaStore.Audio.Media.DURATION));
  
              if(String.valueOf(songDuration) != null){
                  try{
                      Long time = Long.valueOf(songDuration);
                      long seconds = time/1000;
                      long minutes = seconds/60;
                      seconds = seconds % 60;
  
                      if(seconds&lt;10){
                          String csongs_duration = String.valueOf(minutes) + ":0" + String.valueOf(seconds);
                          songDetails.setSongDuration(csongs_duration);
                      }else{
                          String ccsongs_duration = String.valueOf(minutes) + ":" + String.valueOf(seconds);
                          songDetails.setSongDuration(ccsongs_duration);
                      }
                  }catch(NumberFormatException e){
                  }
              }else{
                  String nothing = "0";
                  songDetails.setSongDuration(nothing);
              }
              songDetailsList.add(songDetails);
          }while(musicCursor.moveToNext());
      }
  
      return songDetailsList;
  }
  </code></pre>
  
  <p>Know I want to get image of that particular song.</p>