title: How to play mp3 files from internal and external SD card in android?
body: <p>I am working on a mp3 player app, which plays .mp3 files present anywhere inside an internal SD card.</p>
  
  <p>I have used the following codes to fetch the .mp3 files present in internal storage.</p>
  
  <pre><code>ArrayList&lt;File&gt; inFiles = new ArrayList&lt;File&gt;();
  File list[] = file.listFiles();
  //Log.i("DIR", "PATH" +file.getPath());
  for (int i = 0; i &lt; list.length; i++) 
  {
      // myList.add( list[i].getName() );
      File temp_file = new File(file.getAbsolutePath(),list[i].getName());
      //Log.i("DIR", "PATH" +temp_file.getAbsolutePath());
      if (temp_file.listFiles() != null) 
      {
          //Log.i("inside", "call fn");
          listfiles(temp_file);
  
      }
      else 
      {
          if (list[i].getName().toLowerCase().contains(".mp3"))
          {
              inFiles.add(list[i]);
          //Log.e("Music", list[i].getName());
          }
      }
  }
  </code></pre>
  
  <p>How do I similarly get the .mp3 files from external SD card as well?</p>