Amir Panahandeh
Amir Panahandeh

Reputation: 9029

Get directory of both internal storage and sd card if exist

I need to get directory of both internal storage and SD card if exists. but I've searched and I didn't find something helpful. how can i do that? i need to scan both of them for specific type of files. this code gives me Internal Storage Directory and not my SD card:

File file = new File(Environment.getExternalStorageDirectory()+"/");

Upvotes: 0

Views: 70

Answers (2)

Want2bExpert
Want2bExpert

Reputation: 527

There are thousands of links for tutorials, Android developer page is one of the many, below is the link ;

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

As far as I know, you can have access to your app internal dir and query whether sd card is mounted etc. But to get full access to device internal Dir? I doubt it because it would be breach of user's privacy. You even require user permission to query external storage

Upvotes: 1

Guy Ben Hemo
Guy Ben Hemo

Reputation: 110

Try this line:

File sd = Environment.getExternalStorageDirectory();

Upvotes: 0

Related Questions