问题描述
- 安卓,怎么获取CPU名称
- 安卓开发,想获取硬件设备中的CPU名称。用Build类获取的并不完全正确,但是/proc/cpuinfo文件下的格式不固定。怎么才能获取到CPU名
解决方案
用下面这样的不行吗?
private static String getCpuName(){
try{
FileReader fr = new FileReader(""/proc/cpuinfo"");
BufferedReader br = new BufferedReader(fr);
String text = br.readLine();
String[] array = text.split("":s+""2);
for(int i = 0; i < array.length; i++){
}
return array[1];
}catch(FileNotFoundExecption e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
return null;
}
解决方案二:
http://www.apkbus.com/forum.php?mod=viewthread&tid=125429
时间: 2022-12-22