/**
* 读取文件cpuinfo。
*/
public static String readCpuHardware() throws IOException {
File file = new File("proc/cpuinfo");
FileReader in = new FileReader(file);
LineNumberReader reader = new LineNumberReader(in);
String s = reader.readLine();
String str = null;
while (s != null) {
if (s.contains("Hardware")) {
str = s.replaceAll("Hardware", "");
reader.close();
in.close();
return str.replaceAll(":", "");
}
s = reader.readLine();
}
reader.close();
in.close();
return "";
}
Android 读取CPU信息方法
最新推荐文章于 2024-07-03 12:11:11 发布