編輯:關於Android編程
ActivityManager activityManager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE); MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); activityManager.getMemoryInfo(memoryInfo); Log.i(TAG, " memoryInfo.availMem " + memoryInfo.availMem + "n" ); Log.i(TAG, " memoryInfo.lowMemory " + memoryInfo.lowMemory + "n" ); Log.i(TAG, " memoryInfo.threshold " + memoryInfo.threshold + "n" ); List<RunningAppProcessInfo> runningAppProcesses = activityManager.getRunningAppProcesses(); Map<Integer, String> pidMap = new TreeMap<Integer, String>(); for (RunningAppProcessInfo runningAppProcessInfo : runningAppProcesses) { pidMap.put(runningAppProcessInfo.pid, runningAppProcessInfo.processName); } Collection<Integer> keys = pidMap.keySet(); for(int key : keys) { int pids[] = new int[1]; pids[0] = key; .os.Debug.MemoryInfo[] memoryInfoArray = activityManager.getProcessMemoryInfo(pids); for(.os.Debug.MemoryInfo pidMemoryInfo: memoryInfoArray) { Log.i(TAG, String.format("** MEMINFO in pid %d [%s] **n",pids[0],pidMap.get(pids[0]))); Log.i(TAG, " pidMemoryInfo.getTotalPrivateDirty(): " + pidMemoryInfo.getTotalPrivateDirty() + "n"); Log.i(TAG, " pidMemoryInfo.getTotalPss(): " + pidMemoryInfo.getTotalPss() + "n"); Log.i(TAG, " pidMemoryInfo.getTotalSharedDirty(): " + pidMemoryInfo.getTotalSharedDirty() + "n"); } }
引言【轉載請注明出處:從Handler+Message+Looper源碼帶你分析Android系統的消息處理機制 CSDN 廢墟的樹】作為Android開發者,相信很多人
Android提供了 VideoView組件,它的作用與ImageView類似,只是ImageView用於顯示圖片,而VideoView用於播放視頻。 使用
中國電信發布了“天翼4G+”品牌,號稱比移動4G、聯通4G速度更快。4G才剛普及不久,現在又冒出來個4G+,4G+是什麼意思呢?需要
Android App的圖形用戶界面是由一層層的View和ViewGroup對象建立起來的。View對象一般是UI控件(widgets),例如button 或者 text