Java tutorial
//package com.java2s; import android.app.ActivityManager; import android.content.Context; public class Main { public static long getAvailMem(Context context) { ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); am.getMemoryInfo(memoryInfo); return memoryInfo.availMem; } }