We would like to know how to get usable space size for a path.
/*from w ww.j a v a 2s. c o m*/ import java.io.File; import android.os.StatFs; public class Main { public static long getUsableSpace(File path) { try{ final StatFs stats = new StatFs(path.getPath()); return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks(); }catch (Exception e) { e.printStackTrace(); return -1; } } }