Java tutorial
//package com.java2s; import java.lang.reflect.Method; import android.app.ActivityManager; public class Main { private static Method methodGetLargeMemoryClass = null; static public int getLargeMemoryClass(ActivityManager am) { if (methodGetLargeMemoryClass != null) { try { Object result = methodGetLargeMemoryClass.invoke(am); return (Integer) result; } catch (Throwable t) { t.printStackTrace(); } } return am.getMemoryClass(); } }