Created
March 20, 2024 13:17
-
-
Save mutkuensert/5f5357cb8db74edd8a3426998ef35c17 to your computer and use it in GitHub Desktop.
Getting total memory of Android device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val activityManager = (context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager) | |
val memoryInfo = ActivityManager.MemoryInfo() | |
activityManager.getMemoryInfo(memoryInfo) | |
val totalMemory = memoryInfo.totalMem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment