I\'ve run into a problem that appears to affect only dual-core Android devices running Android 2.3 (Gingerbread or greater. I\'d like to give a di
Android
Android 2.3
I use a combination of both available solutions:
fun getCPUCoreNum(): Int { val pattern = Pattern.compile("cpu[0-9]+") return Math.max( File("/sys/devices/system/cpu/") .walk() .maxDepth(1) .count { pattern.matcher(it.name).matches() }, Runtime.getRuntime().availableProcessors() ) }