private ActivityManager am;
am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo outInfo = new ActivityManager.MemoryInfo();
am.getMemoryInfo(outInfo);
return outInfo.availMem;
返回的是 long 型的byte数据。
private ActivityManager am;
am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo outInfo = new ActivityManager.MemoryInfo();
am.getMemoryInfo(outInfo);
return outInfo.availMem;
返回的是 long 型的byte数据。