On Apr 30, 5:38 am, Mark Murphy <[email protected]> wrote:
> First, you use Environment.getExternalStorageDirectory() to get at the
> root of external storage, rather than hard-wiring in /sdcard (which is
> the wrong value, anyway).

It is not quite as simple as that. Many Android devices have several
kinds of external memory.  There is the truly removable kind like a
physical SD or micro SD card.  Then there is built-in external memory
that cannot be removed, but in every other respect it acts like
external memory, especially in the relaxation of security requirements
for access.  That is, an application can write to the root of external
memory (of whatever kind) but it cannot write to the root of internal
memory.

It has been my experience that
Environment.getExternalStorageDirectory() which you mentioned
generally points to the built-in kind of external memory.  So if you
want to access the real removable SD card file system there is no way
I know of other than hard-wiring the actual path name, or letting the
user enter it on a form (assuming the user even knows what the path
name is).  For example, on the Acer Iconia Tablet A-100 there is

  /mnt/sdcard         (built-in "external" memory")
  /mnt/external_sd  (removable SD card)

But Environment.getExternalStorageDirectory() returns "/mnt/sdcard".

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to