Code example for ActivityManager

Methods: getProcessMemoryInfo

0
		long iMem = 0;
		// ���øý���ռ�õ��ڴ� 
		int[] myMempid = new int[] { iPid };
		ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
		// ��MemoryInfoλ��android.os.Debug.MemoryInfo���У�����ͳ�ƽ��̵��ڴ���Ϣ 
		Debug.MemoryInfo[] memoryInfo = am.getProcessMemoryInfo(myMempid);
		// ��ȡ����ռ�ڴ�����Ϣ kb��λ 
		iMem = memoryInfo[0].dalvikPrivateDirty;
		return iMem;
	} 
	 
	public static void logv(String tag, String log) {
		Log.v(tag, "TIJ: " + log);
	} 
 
	public static void logd(String tag, String log) {
		Log.d(tag, "TIJ: " + log);
	} 
 
	public static void logi(String tag, String log) {
		Log.i(tag, "TIJ: " + log);