开发者

How to browse files stored on android SD memory?

开发者 https://www.devze.com 2023-02-03 13:47 出处:网络
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 Devel

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:

  1. Write your own Activity which will do browsing task - it's not very difficult. You'd need to fetch ListView with file list returned by File.listFiles();
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消