And*_*rew 1 cpu android arm cpu-architecture abi
有没有办法以编程方式检索ARM处理器版本?我正在尝试将其发送到Google Analytics.有人告诉我这是在/ proc/cpuinfo中文件夹,但我不能确定如何检索代码信息.
谢谢,安德鲁
来自http://android-er.blogspot.com/2009/09/read-android-cpu-info.html:
private String ReadCPUinfo()
{
ProcessBuilder cmd;
String result="";
try{
String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
cmd = new ProcessBuilder(args);
Process process = cmd.start();
InputStream in = process.getInputStream();
byte[] re = new byte[1024];
while(in.read(re) != -1){
System.out.println(new String(re));
result = result + new String(re);
}
in.close();
} catch(IOException ex){
ex.printStackTrace();
}
return result;
}
Run Code Online (Sandbox Code Playgroud)
您可以split在结果中的每一行上查找并查找以该行开头的行Processor.
| 归档时间: |
|
| 查看次数: |
1493 次 |
| 最近记录: |