opt05
opt05

Reputation: 852

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;
}

Upvotes: 3

Views: 1316

Answers (2)

CodeWalker
CodeWalker

Reputation: 2378

Have a look at android.os.Build.VERSION.

CODENAME : The current development codename, or the string "REL" if this is a release build.
INCREMENTAL : The internal value used by the underlying source control to represent this build.
RELEASE : The user-visible version string.

Upvotes: 1

vdelricco
vdelricco

Reputation: 759

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.

Upvotes: 2

Related Questions