get the cpu version [ 740 views ]
Goal: find out the heart of a device
It is easy to find the version of the central unit in my device. Seemingly…
1. the android way
Use the Build class like this:
String cpu = Build.HARDWARE;
2. get info from the company (as I see they can give what they want…)
Read the /proc/cpuinfo file.
public static String cpuInfo() { StringBuffer sb = new StringBuffer(); sb.append("abi: ").append(Build.SUPPORTED_ABIS).append("\n"); if (new File("/proc/cpuinfo").exists()) { try { BufferedReader br = new BufferedReader(new FileReader(new File("/proc/cpuinfo"))); String aLine; while ((aLine = br.readLine()) != null) { sb.append(aLine + "\n"); } if (br != null) { br.close(); } } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); }
So in a Homtom HT17 this is different 🙂
The android say: 6735 (is this the real one?)
and in the cpuinfo: 6737 (like in the specification)