I need to get the app ram and internal storage in GB (Gigabytes).
I tried this
private void getAppRam() {
String DeviceModel = android.os.Build.MODEL;
String DeviceName = android.os.Build.MANUFACTURER;
String sdk = Build.VERSION.RELEASE;
System.out.println("DeviceModel...." + DeviceModel);
System.out.println("DeviceName ...." + DeviceName);
System.out.println("sdk ...." + sdk);
ActivityManager actManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
actManager.getMemoryInfo(memInfo);
long totalMemory = memInfo.totalMem / (1024 * 1024);
System.out.println("ram...." + totalMemory);
}
But did not found accurate results, and can someone suggest any solution for internal storage.