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
Here you go (JAVA) :
try {
int ch, processorCount = 0;
Process process = Runtime.getRuntime().exec("cat /proc/cpuinfo");
StringBuilder sb = new StringBuilder();
while ((ch = process.getInputStream().read()) != -1)
sb.append((char) ch);
Pattern p = Pattern.compile("processor");
Matcher m = p.matcher(sb.toString());
while (processorCount.find())
processorCount++;
System.out.println(processorCount);
} catch (IOException e) {
e.printStackTrace();
}