1

I have created some text files in the SD card, but I am unable to view my files.

I am using this path Environment.getExternalStorageDirectory(); to create files.

I am not getting any exception while creating files.

when I open the DDMS in eclipse I am unable to see my files there also..

If I created the files at

Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);

then I can see my files at /data folder of the device , but not in SD card itself.

When I click on the gallery icon in my device, I can see only pictures, videos, camera shots folders only but not my files ..

please suggest is that the proper way of creating files in SD card. thanks.

Balanivash
  • 6,709
  • 9
  • 32
  • 48
brig
  • 305
  • 2
  • 6
  • 12

1 Answers1

0

Environment.getExternalStorageDirectory() doesn't always return the location to an external card. On android tablets (Android 3.0+) this directory is often mounted in the internal memory.

From the docs:

Note: don't be confused by the word "external" here. This directory can better be thought as media/shared storage. It is a filesystem that can hold a relatively large amount of data and that is shared across all applications (does not enforce permissions). Traditionally this is an SD card, but it may also be implemented as built-in storage in a device that is distinct from the protected internal storage and can be mounted as a filesystem on a computer.

AFAIK there is no generic way to determine the mountpoint of an sdcard, this is specified by the device manufacturer. For example the ASUS Transformer mounts the external cards in /Removable/MicroSD and /Removable/SD . The "External Storage" directory /sdcard/ is mounted in internal space.

Gryphius
  • 75,626
  • 6
  • 48
  • 54