Monday, July 23, 2018

version numbering - How to get device (AOSP) Build Number in Android devices programmatically?



From within an Android Application, how can the hosting device's Build Number, as displayed in System Settings -> About Tablet -> Build Number be obtained programmatically for use within a Java Android application?



System Settings version number on tablet




Currently, I'm using "android.os.Build".


Answer



Check this code..



in Build.FINGERPRINT you'll get the Build Number of the Device.



String mString = "";

mString.concat("VERSION.RELEASE {" + Build.VERSION.RELEASE + "}");
mString.concat("\nVERSION.INCREMENTAL {" + Build.VERSION.INCREMENTAL + "}");

mString.concat("\nVERSION.SDK {" + Build.VERSION.SDK + "}");
mString.concat("\nBOARD {" + Build.BOARD + "}");
mString.concat("\nBRAND {" + Build.BRAND + "}");
mString.concat("\nDEVICE {" + Build.DEVICE + "}");
mString.concat("\nFINGERPRINT {" + Build.FINGERPRINT + "}");
mString.concat("\nHOST {" + Build.HOST + "}");
mString.concat("\nID {" + Build.ID + "}");

((TextView) findViewById(R.id.textView1)).setText(mString);



My Device Build Number :



My Device Build Number



FINGERPRINT return by the above code



enter image description here


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...