public boolean hasSdcard(){
  String state=Environment.getExternalStorageState();
  if (state.equals(Environment.MEDIA_MOUNTED)) {
    return true;
  }
 else {
    return false;
  }
}

public boolean hasSdcard ( ) { String state = Environment . getExternalStorageState ( ) ; if ( state . equals ( Environment . MEDIA_MOUNTED ) ) { return true ; } else { return false ; } }
judge if device has sd card
