Java tutorial
//package com.java2s; import android.os.Environment; import android.os.StatFs; public class Main { public static long FreeMemory() { StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getAbsolutePath()); long Free = (statFs.getAvailableBlocksLong() * statFs.getBlockSize()) / 1048576; return Free; } }