Marcel Bagautdinov
Marcel Bagautdinov

Reputation: 11

Full CPU info (Android Developing)

If can I to get all of these CPU info? In proc/cpuinfo shows instructions set. Thanks. Image

Upvotes: 1

Views: 964

Answers (1)

Garry
Garry

Reputation: 4533

You can try like this:

private String getInfo() {
    StringBuffer sb = new StringBuffer();
    sb.append("abi: ").append(Build.CPU_ABI).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();
}

output

Source for further reference: how-to-get-cpu-information-on-android

Upvotes: 1

Related Questions