title: MediaStore list all songs from specific path
body: <p>I want to get all the songs from one specific path on the device.
  in a example i want to get all the songs from one specific folder "music" from path: "/mnt/sdcard/music/" , what i need to change in my code to able to achieve this?
  i have this method that get all the songs from the device:</p>
  
  <pre><code>public ArrayList&lt;Song&gt; scanAllSongsOnDevice(Context c)
      {
          ContentResolver musicResolver = c.getContentResolver();
          Uri musicUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
          String col[] ={android.provider.MediaStore.Audio.Media._ID};
  Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
  
  
          if (musicCursor != null &amp;&amp; musicCursor.moveToFirst())
          {
              // clear  list to prevent duplicates
              songsList = new ArrayList&lt;&gt;();
  
              //get columns
              int titleColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media.TITLE);
              int idColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media._ID);
              int artistColumn = musicCursor.getColumnIndex
                      (android.provider.MediaStore.Audio.Media.ARTIST);
              int isMusicColumn = musicCursor.getColumnIndex
                      (MediaStore.Audio.Media.IS_MUSIC);
              int duration = musicCursor.getColumnIndex
                      (MediaStore.Audio.Media.DURATION);
  
              //add songs to list
              do
              {
                  String filePath = musicCursor.getString(musicCursor.getColumnIndex(MediaStore.Audio.Media.DATA));
                  // check if the file is a music and the type is supported
                  if (musicCursor.getInt(isMusicColumn) != 0 &amp;&amp; filePath != null &amp;&amp; (FileExtensionFilter.checkValidExtension(filePath)) &amp;&amp; musicCursor.getInt(duration) &gt; 0)
                  {
                      int thisId = musicCursor.getInt(idColumn);
                      String thisTitle = musicCursor.getString(titleColumn);
                      String thisArtist = musicCursor.getString(artistColumn);
                      Song song = new Song();
                      song.setId(thisId);
                      if(!thisArtist.equals("&lt;unknown&gt;"))
                      {
                          song.setArtist(thisArtist);
                          song.setTitle(thisTitle);
                      }
                      else
                      {
                          song.setArtist("");
                          song.setTitle("");
                      }
                      song.setSongPath(filePath);
                      File file = new File(filePath);
                      song.setFileName(file.getName().substring(0, (file.getName().length() - 4)));
                      songsList.add(song);
                  }
              }
              while (musicCursor.moveToNext());
          }
          else  // if we don't have any media in the folder that we selected set NO MEDIA
          {
              addNoSongs();
          }
  
          musicCursor.close();
  
          if(songsList.size() == 0)
          {
              addNoSongs();
          }
  
          Collections.sort(songsList, new Comparator&lt;Song&gt;()
          {
              @Override
              public int compare(Song song, Song song2)
              {
                  int compare = song.getTitle().compareTo(song2.getTitle());
                  return ((compare == 0) ? song.getArtist().compareTo(
                          song2.getArtist()) : compare);
              }
          });
  
          return songsList;
      }
  </code></pre>