{"id":867,"date":"2016-07-29T11:45:01","date_gmt":"2016-07-29T11:45:01","guid":{"rendered":"http:\/\/blog.silverterra.net\/?p=867"},"modified":"2016-07-29T11:45:01","modified_gmt":"2016-07-29T11:45:01","slug":"get-the-cpu-version","status":"publish","type":"post","link":"https:\/\/blog.silverterra.net\/?p=867","title":{"rendered":"get the cpu version"},"content":{"rendered":"<blockquote><p>Goal: find out the heart of a device<\/p><\/blockquote>\n<p>It is easy to find the version of the central unit in my device. Seemingly&#8230;<\/p>\n<p><strong>1. the android way<\/strong><br \/>\nUse the Build class like this:<\/p>\n<pre data-enlighter-language=\"java\" class=\"EnlighterJSRAW\">\r\n  String cpu = Build.HARDWARE;\r\n<\/pre>\n<p><strong>2. get info from the company<\/strong> (as I see they can give what they want&#8230;)<br \/>\nRead the <strong>\/proc\/cpuinfo<\/strong> file.<\/p>\n<pre data-enlighter-language=\"java\" class=\"EnlighterJSRAW\">\r\n  public static String cpuInfo() {\r\n    StringBuffer sb = new StringBuffer();\r\n    sb.append(&quot;abi: &quot;).append(Build.SUPPORTED_ABIS).append(&quot;\\n&quot;);\r\n    if (new File(&quot;\/proc\/cpuinfo&quot;).exists()) {\r\n      try {\r\n        BufferedReader br = new BufferedReader(new FileReader(new File(&quot;\/proc\/cpuinfo&quot;)));\r\n        String aLine;\r\n        while ((aLine = br.readLine()) != null) {\r\n          sb.append(aLine + &quot;\\n&quot;);\r\n        }\r\n        if (br != null) {\r\n          br.close();\r\n        }\r\n      } catch (IOException e) {\r\n        e.printStackTrace();\r\n      }\r\n    }\r\n    return sb.toString();\r\n  }   \r\n<\/pre>\n<p>So in a Homtom HT17 this is different \ud83d\ude42<br \/>\nThe android say: 6735 (is this the real one?)<br \/>\nand in the cpuinfo: 6737 (like in the specification)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Goal: find out the heart of a device It is easy to find the version of the central unit in my device. Seemingly&#8230; 1. the android way Use the Build class like this: 2. get info from the company (as I see they can give what they want&#8230;) Read the \/proc\/cpuinfo file. So in a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-867","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=867"}],"version-history":[{"count":1,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/867\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=\/wp\/v2\/posts\/867\/revisions\/868"}],"wp:attachment":[{"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.silverterra.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}