public static boolean hasSDCardMounted(){
  String state=Environment.getExternalStorageState();
  return state != null && state.equals(Environment.MEDIA_MOUNTED);
}

public static boolean hasSDCardMounted ( ) { String state = Environment . getExternalStorageState ( ) ; return state != null && state . equals ( Environment . MEDIA_MOUNTED ) ; }
check if the primary " external " storage device is available .
