I can get total available memory by:
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);
memoryInfo.availMem;
However, how do you get Total memory (RAM) of the device?
I did read:
How do I discover memory usage of my application in Android?
It doesn't seem like adding pidMemoryInfo.getTotalPss() gives me the total memory either.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…