Search code examples
androidsd-card

Android devices with Environment.getExternalStorageDirectory() != /mnt/sdcard/?


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


Solution

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