Java tutorial
//package com.java2s; import android.os.Environment; import android.os.StatFs; public class Main { /** * @return Free size in SDcard */ private static int sdFreeSize() { StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath()); long bytesAvailable = (long) stat.getBlockSize() * (long) stat.getAvailableBlocks(); int sdFreeMegs = (int) (bytesAvailable / (1024 * 1024)); return sdFreeMegs; } }