private fun getMemoryUsage(): Float { val runtime = Runtime.getRuntime() val usedMem = runtime.totalMemory() - runtime.freeMemory() return usedMem.toFloat() / runtime.totalMemory() } }
data class HealthReport(val batteryPercent: Int, val freeStorageMB: Long, val memoryUsagePercent: Float) technocareapk
private fun getFreeStorageSpace(): Long { val stat = StatFs(Environment.getDataDirectory().path) return stat.availableBlocksLong * stat.blockSizeLong } private fun getMemoryUsage(): Float { val runtime = Runtime
If this isn't what you meant, please share more details and I’ll refine the answer completely. val freeStorageMB: Long