Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get android cpu model name?

I want to learn my phone cpu model name and I tryed to use /proc/cpuinfo and a lot of code but I failed. Can anyone help me?

like image 444
berk şahin Avatar asked Oct 25 '25 04:10

berk şahin


2 Answers

Run

$ adb shell cat /proc/cpuinfo
like image 65
Diego Torres Milano Avatar answered Oct 27 '25 18:10

Diego Torres Milano


Here is my code

public static String getCpuName() {
    try {
        FileReader fr = new FileReader("/proc/cpuinfo");
        BufferedReader br = new BufferedReader(fr);
        String text = br.readLine();
        br.close();
        String[] array = text.split(":\\s+", 2);
        if (array.length >= 2) {
            return array[1];
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}

What about your code?

like image 26
qingfei song Avatar answered Oct 27 '25 19:10

qingfei song