Here you can find the source of getUsableSpace(File path)
public static long getUsableSpace(File path)
//package com.java2s; import java.io.File; import android.os.StatFs; import android.util.Log; public class Main { private static final String TAG = "BitmapCommonUtils"; public static long getUsableSpace(File path) { try {// www . j ava 2s.co m final StatFs stats = new StatFs(path.getPath()); return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks(); } catch (Exception e) { e.printStackTrace(); return -1; } } }