I'm developing an app that checks Android version and Ram Memory Size.
How can I get this information?
I'm developing an app that checks Android version and Ram Memory Size.
How can I get this information?
The version of Android can be obtained through the class Build.VERSION .
String release = Build.VERSION.RELEASE;
Values, in Mb, relative to RAM can be obtained as follows:
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long memoriaLivre = mi.availMem / 1048576L;
long memoriaTotal = mi.totalMem / 1048576L;
long memoriaEmUso = totalMemory - freeMemory;
The value of totalMem is the total memory available to the kernel, which is approximately equal to the total RAM.