Check SD Card is present in device

by Sasikumar 2013-10-19 19:06:37

To check SD Card is present in android device:
Sometimes we need to read/write files on SD Card due to large memory size. In those cases its better to check whether SD Card is present in the device. The following function would do the need


public static boolean isSdPresent()
{
return android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
}


Making a call to this function would return "true" if sd card is installed or "false"" if sd card is not present.
947
like
0
dislike
0
mail
flag

You must LOGIN to add comments