Android examples for android.os:Memory
get Max Memory Size
import android.content.Context; import android.os.Build; import android.os.Environment; import android.os.StatFs; import java.io.File; public class Main{ public static int getMaxMemorySize(Context context) { ActivityManager activityManager = (ActivityManager) context .getSystemService(Activity.ACTIVITY_SERVICE); if (activityManager == null) { return 16 * (1 << 20); }// w w w . jav a 2 s .co m return activityManager.getMemoryClass() * (1 << 20); } }