Sometimes we need to know whether an SD card is present or not. So here is a check to see if an SD card is present. It returns true if the SD card is present and writable, false otherwise.
Using java Syntax Highlighting
- public static boolean isSdPresent() {
- return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
- }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Thanks to Avolovoy for pointing me in the right direction!


.
