views:

89

answers:

3

How would I go about getting an array of all the files in a specific directory on the sdcard, i.e. /ringtones/?

A: 

You should try this : http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

Hope I have helped. Regards from France ;)

Squ36
A: 

It's very simple. Just do the following:

File dir = new File(path);
String[] files = dir.list();
irlennard
A: 

You are looking in a specific location and obviously if you are looking in the ringtones directory you want audio type files. Here is exactly how to accomplish that task.

I have created an example application for you that shows exactly how to accomplish this task

Source Code: Find files by type + play media file

androidworkz
excellent tutorial, thanks for going the extra mile
Edward