Java tutorial
//package com.java2s; import android.app.ActivityManager; import android.app.ActivityManager.MemoryInfo; import android.content.Context; import android.text.format.Formatter; public class Main { public static String getAvailMemory(Context c) { ActivityManager am = (ActivityManager) c.getSystemService(Context.ACTIVITY_SERVICE); MemoryInfo mi = new MemoryInfo(); am.getMemoryInfo(mi); return Formatter.formatFileSize(c, mi.availMem); } }