Here you can find the source of FreeMemory()
public static int FreeMemory()
//package com.java2s; import android.os.Environment; import android.os.StatFs; public class Main { public static int FreeMemory() { StatFs statFs = new StatFs(Environment .getExternalStorageDirectory().getAbsolutePath()); int Free = (statFs.getAvailableBlocks() * statFs.getBlockSize()) / 1048576; return Free; }//w w w. jav a 2 s. co m }