I was looking to determine(or count) the number of cores in the embedded processor of android device.
I tried using /proc/cpuinfo
, but it is not return
You can try this method to get number of core.
private int getNumOfCores()
{
try
{
int i = new File("/sys/devices/system/cpu/").listFiles(new FileFilter()
{
public boolean accept(File params)
{
return Pattern.matches("cpu[0-9]", params.getName());
}
}).length;
return i;
}
catch (Exception e)
{
e.printstacktrace();
}
return 1;
}