简体   繁体   中英

In android how can I get a list of all external memory installed

I am developing an android application and for creating an directory on sdcard I have used the method

File myMedia = new File(Environment.getExternalStorageDirectory(),"MySaveCellData");

But this is creating the directory MYSaveCellData in to the internal memory. However, this phone has a an internal memory of 8 GB and has a 16 GB external card.

In normal phones its creating directory on external disk.

Let me know the solution.

I am finding a way to get a list of all external drive installed on a android phone.

In normal phones its creating directory on external disk.

Not for all "normal phones". Some phones do not have "external disk" in the form of an SD card.

Let me know the solution.

There is no "solution". It is up to the device manufacturer to determine what is "external storage" for their device. If they choose to make it be on-board flash instead of an SD card, that is their choice.

I am finding a way to get a list of all external drive installed on a android phone.

Android has exactly one "external drive", referred to as "external storage". If a device manufacturer supports both an on-board flash area as "external storage" and a SD card, Android will not know about the SD card.

SDK developers should simply use external storage, as your code does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM