Code example for ActivityManager

Methods: getMemoryInfogetProcessMemoryInfo

0
                .getSystemService(Context.TELEPHONY_SERVICE);
        sNullIntentStartCounter = CrashedStartCounter.getInstance(sContext);
 
    } 
     
    public void deactivate() { 
        super.deactivate(); 
        activityManager = null;
        connectivityManager = null;
        telephonyManager = null;
    } 
 
    @Override 
    protected void execute(String cmd, String args) {
        XmppMsg res = new XmppMsg(); 
        if (isMatchingCmd("sysinfo", cmd)) {
            ActivityManager.MemoryInfo memInfoSystem = new ActivityManager.MemoryInfo();
            activityManager.getMemoryInfo(memInfoSystem);
            MemoryInfo[] memInfoProc = activityManager.getProcessMemoryInfo(myPidArray);
            appendMemInfo(res, memInfoProc[0]);
            res.newLine();