How to browse files stored on android SD memory?
I wa开发者_如何学Gont to be able to browse the files using android application and get the path of selected files. How can i do that ??
You should read this section on Data Storage in the Android Developer APIs. Lots of good information here on how you access the SD card. Browsing it would be an extension of accessing the card's data. (Get a listing of the files on the SD card, and then display them to the user.)
Use standard java classes as File.listFiles();
. View the files any way you like in an activity - in a ListView for example. You may also need the method from the Environment class.
Basically there are 2 options how to do it:
- Write your own Activity which will do browsing task - it's not very difficult. You'd need to fetch
ListView
with file list returned byFile.listFiles();
- Use any
Intent
which supports File browsing/managing - simply by calling those Intent. E.g. like this one
You can use DDMS to browse the files inside Android application.
精彩评论