Of course in my code I use Environment.getExternalStorageDirectory() instead of hardwiring /mnt/sdcard/. But I just realized that when I export data from my application via a database dump in an exchange format, file paths are /mnt/sdcard/... This may explain some strange errors that I have seen in the logs from users.
I will make the appropriate changes in the import modules. But I am curious - does any Android devices > 1.6 have Environment.getExternalStorageDirectory() != /mnt/sdcard/ ?
No. I haven't seen any devices with sdcard mounted to different location. And I've played with more then 10 different devices from most popular vendors.
Having said that, you shouldn't rely on this fact. Especially if you have such an easy way to get path to External storage.
I had a user of one of my apps report this, he was using Andy 2.2 IIRC but I can't remember what device he was using. The path can be found using
Environment.getExternalStorageDirectory().getPath()
I think the path my user got was /sdcard & not /mnt/sdcard like my HTC phone does.
Actually, some for some devices the getExternalStorageDirectory()
will return localization for internal memory (internal SD card). The removable SD card is located as mount point below, usually getExternalStorageDirectory()+"/sd"
or getExternalStorageDirectory()+"/external_sd"
. Unfortunately, there is no standard for this and you won't know what kind of storage you are pointing at.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With