For some Android devices, Environment.getExternalStorageDirectory() does not return the path of the SD card. In fact, there is no API support that will enumerate SD card mount points.
If you want to see what is mounted, you are left to parsing the contents of /proc/mounts. See http://stackoverflow.com/questions/7251793/android-absolute-location-of-external-sd-card for more discussion of this issue. On Jul 20, 10:39 pm, Qin <[email protected]> wrote: > Hi there, > > In my application, I want to get SD card current state, mount or > unmounted. While my phone has two external storage. One is built-in > storage (phone storage) and the other is SD card storage. I use > Environment.getExternalStorageDirectory() to get the path like /mnt/sdcard/, > in order to distinguish if the storage is built-in or sd > card, I also check the 'isExternalStorageRemovable()', if true, that > means it's sd card. > > Actually, after running app, I always get SD card mount state even I > don't insert it. So I want to know how to get SD card mount or > unmounted status if the phone has two external storage? > > Thanks. > Qin -- 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

