Get the memory class of this device (approx. - Android java.lang.reflect

Android examples for java.lang.reflect:Class

Description

Get the memory class of this device (approx.

Demo Code


//package com.book2s;

import android.app.ActivityManager;
import android.content.Context;

public class Main {
    /**//from w ww  .  j a v  a 2s  .  c o  m
     * Get the memory class of this device (approx. per-app memory limit)
     *
     * @param context
     * @return
     */

    public static int getMemoryClass(Context context) {
        return ((ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE))
                .getMemoryClass();
    }
}

Related Tutorials