single application memory max size limit - Android Hardware

Android examples for Hardware:Memory

Description

single application memory max size limit

Demo Code


//package com.java2s;

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

public class Main {
    /**// w ww .  jav  a2  s . com
     * single application memory max size limit
     * 
     * @param context
     * @return Unit KB
     */
    public static int getCacheSize(Context context) {
        return 1024 * ((ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE))
                .getMemoryClass();
    }
}

Related Tutorials