Tôi có thể lấy tổng bộ nhớ có sẵn theo:Android Làm thế nào để bạn nhận được tổng bộ nhớ RAM trong thiết bị?
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);
memoryInfo.availMem;
Tuy nhiên, làm thế nào để bạn có được Tổng bộ nhớ (RAM) của thiết bị?
tôi đã đọc: How do I discover memory usage of my application in Android?
Nó dường như không giống như thêm pidMemoryInfo.getTotalPss() mang lại cho tôi tổng bộ nhớ một trong hai.
Tôi đoán bạn có thể thực hiện theo cách này 'memoryInfo.totalMem' –