As mentioned in the title, I'm looking for a way to get the number of cores of an android device, but without the hyperthreated cores that count as two.
I found that function to get the number of cores:
Runtime.getRuntime().availableProcessors()
But a comment here How to get the number of cores of an android device points at that it will count hyperthreated cores double.
So how to avoid that?
Update
I tried to get it with (thanks to this website: https://myshell.co.uk/blog/2012/07/how-to-determine-the-number-of-physical-cpus-on-linux/)
cat /proc/cpuinfo | grep "cpu cores" | uniq
It works with Emulator, but not with a real device. That is the cpuinfo:
Processor : ARMv7 Processor rev 3 (v7l)
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 33.76
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc07
CPU revision : 3
Hardware : MT6580M
Revision : 0000
Serial : 0000000000000000
So there is no line including 'cpu cores'. Is there any other way to get it?