Search code examples
javaandroidmotorola-droid

Android System Version


On my Moto Maxx & Moto Razr HD (probably all Moto devices), there is an entry in the About Phone settings that states System version. I am writing an app that pulls this info from the phone but I cannot find where Motorola is pulling that info from. All the Build.VERSION, Build.DISPLAY, etc do not contain it. I have even read in the "/proc/version" from the Linux system, which doesn't contain it as well. Thoughts?Moto About Phone

UPDATE: With everyone's help it pushed me in the right direction. My solution was:

private String getDeviceBuildVersion() {
    //Get Moto Info
        String line = "Note sure...";
        try {
            Process ifc = Runtime.getRuntime().exec("getprop " + "ro.build.version.full");
            BufferedReader bis = new BufferedReader(new InputStreamReader(ifc.getInputStream()));
            line = bis.readLine();
            ifc.destroy();
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
    return line;
}

Solution

  • It's most likely stored as an Android system property.

    Assuming you're connected to the phone through adb, run this command:

    adb shell getprop
    

    This will list all of the system properties set in the system. Look for that system version string and you'll see which property it's stored as. Then when you know the name of the property it's stored as, you can use System.getProperty() to grab it programmatically.

    If it's not there, Motorola is probably hiding the string somewhere in their modified source and unfortunately you won't be able to get to it.