Android examples for Hardware:Memory
get Available Memory information via MemoryInfo
//package com.java2s; import android.app.ActivityManager; import android.app.ActivityManager.MemoryInfo; import android.content.Context; public class Main { public static long getAvailMem(Context context) { MemoryInfo outInfo = new ActivityManager.MemoryInfo(); getManager(context).getMemoryInfo(outInfo); long availMem = outInfo.availMem; return availMem; }//from w w w . j a va 2 s . co m public static ActivityManager getManager(Context context) { return (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); } }