On 04/18/2012 08:41 PM, Nadeem Hasan wrote:
Environment.getExternalStorageDirectory() returns the non-removable external memory location.

On tablets that have both "internal external" and "external external" storage it does.

On tablets and devices that only have "internal external" storage it does.

But on a few hundred million phones with Android 2.* it returns the removable memory card path - except for devices that have both "internal external" and "external external" storage, like some tablets, where it acts like you said.

But I see what you mean, on devices with only removable external memory, it could return that location.

And it does, on phone devices that don't have "internal external" storage.

It got messy with devices that have a large built-in data partition that's separate from the "internal internal" storage that all devices have.

The first was the HTC... oh something or other (I forget). Then the Samsung Galaxy S (GT-i9000).

On both of these devices, Envrionment.getExternalStorageDiretly() returns the path to this "internal external" storage.

The location of the "external external" storage is different on these, and as it happened, there was no appropriate API in Android two return this.

Samsung did the smarter thing (of the two) by mounting the "external external" memory card as /sdcard/sd, so it was a subdirectory of the path returned by Environment.getExternalStorageDirectory().

But at this point, there are more and more devices (tablets, mostly) with both "internal external" and "external external" memory, and the APIs do not address this at all.

And then there is the permission issue.

However, the point remains that the framework only considers one external storage as general purpose R/W storage.

Let me make it clear, I am not against the ability for the API to return all the available external storage locations. I am merely pointing out the possible rationale behind the decisions in the system. I think the same rationales were behind the swith to MTP access in ICS in lieu of USB mass storage access.

As far as I can tell, large part of the rationale behind the switch from USB mass storage to MTP was for Android to retain control over the file system at all times.

Whatever the rationale was, MTP is one thing, MediaStore is another, but I'm just after being able to present the user with a volume/mount point picker and to be sure it can be written to.

-- K

--
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