Reputation: 93
How would I go about getting an array of all the files in a specific directory on the sdcard, i.e. /ringtones/?
Upvotes: 4
Views: 5914
Reputation: 3153
You should try this : http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
Hope I have helped.
Upvotes: -1
Reputation: 2942
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
Upvotes: 0
Reputation: 15881
It's very simple. Just do the following:
File dir = new File(path);
String[] files = dir.list();
Upvotes: 3