title: Android, how do can I get a list of all files in a folder?
body: <p>I need the name (String) of all files in res/raw/</p>
  
  <p>I tried:</p>
  
  <pre><code>File f = new File("/"); 
  String[] someFiles = f.list();
  </code></pre>
  
  <p>It looks like the root directory is the root of the android emulator...and not my computers root directory. That makes enough sense, but doesn't really help me find out where the raw folder exists. </p>
  
  <p><strong>Update: Thanks for all the great replies. It appears that some of these are working, but only getting me half way. Perhaps a more detailed description will aid</strong></p>
  
  <p>I want to get all the mp3 files in the raw folder so I can get all the names, then add them to a URI to play a random MP3 in the following way...</p>
  
  <pre><code>String uriStr = "android.resource://"+ "com.example.phone"+ "/" + "raw/dennis";
  Uri uri = Uri.parse(uriStr);
  singletonMediaPlayer = MediaPlayer.create(c, uri);
  </code></pre>
  
  <p>When I put "dennis.mp3" into the assets folder, it does show up as expected, however, using the above code, I can't access that MP3 anymore, unless there is something along the line of:</p>
  
  <pre><code>String uriStr = "android.assets://"+ "com.example.phone"+ "/" + "dennis";
  Uri uri = Uri.parse(uriStr);
  </code></pre>