public boolean hasEnoughSpaceOnSdCard(long updateSize){
  RootTools.log("Checking SDcard size and that it is mounted as RW");
  String status=Environment.getExternalStorageState();
  if (!status.equals(Environment.MEDIA_MOUNTED)) {
    return false;
  }
  File path=Environment.getExternalStorageDirectory();
  StatFs stat=new StatFs(path.getPath());
  long blockSize=stat.getBlockSize();
  long availableBlocks=stat.getAvailableBlocks();
  return (updateSize < availableBlocks * blockSize);
}

public boolean hasEnoughSpaceOnSdCard ( long updateSize ) { RootTools . log ( "Checking SDcard size and that it is mounted as RW" ) ; String status = Environment . getExternalStorageState ( ) ; if ( ! status . equals ( Environment . MEDIA_MOUNTED ) ) { return false ; } File path = Environment . getExternalStorageDirectory ( ) ; StatFs stat = new StatFs ( path . getPath ( ) ) ; long blockSize = stat . getBlockSize ( ) ; long availableBlocks = stat . getAvailableBlocks ( ) ; return ( updateSize < availableBlocks * blockSize ) ; }
checks if there is enough space on sdcard
