title: android scanning all .mp3 files in SD Card
body: <p>I'm trying to scan all .mp3 files in my SD card and save its name. 
  here is a fragment of code which is responsible for that. 
  1.What i'm doing wrong?
   1. Which is correct path for SD Card /mnt/sdcard or /sdcard ?</p>
  
  <pre><code>public class PlayerActivity extends Activity
  {
  
      public void onCreate(Bundle savedInstanceState)
      {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.player_activity); 
      }
      public class SongsManager 
      {
          // SDCard Path
          //final String MEDIA_PATH = new String(MediaStore.Audio.Media.getContentUri("external").toString());
          private ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          public SongsManager()
          {
  
          }
  
          public ArrayList&lt;HashMap&lt;String, String&gt;&gt; getPlayList()
          {
           //   File home = new File(MEDIA_PATH);
              File home = Environment.getExternalStorageDirectory();
  
              if (home.listFiles(new FileExtensionFilter()).length &gt; 0) 
              {
  
                  for (File file : home.listFiles(new FileExtensionFilter())) 
                  {
                      HashMap&lt;String, String&gt; song = new HashMap&lt;String, String&gt;();
                      song.put("songTitle", file.getName().substring(0, (file.getName().length() - 4)));
                      song.put("songPath", file.getPath());
  
                      // Adding each song to SongList
                      songsList.add(song);
  
                  }
              }
              // return songs list array
              return songsList;
  
          }
  
  
          class FileExtensionFilter implements FilenameFilter 
          {
              public boolean accept(File dir, String name) 
              {
                  return (name.endsWith(".mp3") || name.endsWith(".MP3"));
              }
          }
  
      }
  }
  </code></pre>
  
  <p>Thanks in advance. </p>