Java tutorial
//package com.java2s; import android.app.ActivityManager; import android.app.Service; import android.content.Context; public class Main { public static long getAvailableMemorySize(Context app_context) { ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); ActivityManager activityManager = (ActivityManager) app_context.getSystemService(Service.ACTIVITY_SERVICE); activityManager.getMemoryInfo(mi); return mi.availMem; } }