nikhil
nikhil

Reputation: 9363

List files and sub directories Android

What i want to do is to open a directory through android application and list all the files as well as directories present in that directory. I would also like to retrieve permissions and owner information of each file/directory. This can be achieved in java but how can i do the same in Android?

Upvotes: 2

Views: 4971

Answers (1)

nicholas.hauschild
nicholas.hauschild

Reputation: 42834

The java.io package has been reimplemented within Android. You should be able to use the same mechanisms in Android as you do in Java.

File f = new File("/your/file/path");
File[] files = f.listFiles();

Upvotes: 3

Related Questions