0

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Pravin Prasad
  • 223
  • 6
  • 14
  • 1
    IF you ask a question, you're supposed to follow up on it: mark the best answer as "accepted", or provide your own sollution you've come up with and mark that. Giving a "+1" for good/helpfull answers is good form too. You've not accepted a single answer in your old questions. Please do so, it will help your question as people might be quicker to help you. – Nanne Jun 13 '11 at 11:58
  • Please see below, may be help you.
    http://stackoverflow.com/questions/7450650/how-to-list-additional-external-storage-folders-mount-points/15131810#15131810
    – boiledwater Feb 28 '13 at 09:26

1 Answers1

3

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491