Android How Do You Get Total Memory Ram In The Device?
I can get total available memory by: ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(
Solution 1:
Try this works for me.
publicstaticStringgetTotalRAM() {
RandomAccessFile reader = null;
String load = null;
try {
reader = newRandomAccessFile("/proc/meminfo", "r");
load = reader.readLine();
} catch (IOException ex) {
ex.printStackTrace();
} finally {
// Streams.close(reader);
}
return load;
}
Solution 2:
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
Post a Comment for "Android How Do You Get Total Memory Ram In The Device?"