views:

53

answers:

1

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: http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android

It doesn't seem like adding pidMemoryInfo.getTotalPss() gives me the total memory either.

A: 

If you don't find something else, you could bypass android and read /proc/meminfo which is what the 'free' command on a more ordinary linux distribution does

Chris Stratton