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?
Currently, I'm using "android.os.Build".
The build number is reported in Settings > About phone. For Android Oreo, it is shown in Settings > System > About phone.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have taken text view to show serial number.
The Android version is the build version. It is found in build/make/core/build_id.mk in the aosp android source (https://source.android.com/setup/build/downloading).
A build is a software version for a specific device - hence a build number is of course not unique. All devices with the same software version will have the same build id.
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 :
FINGERPRINT
return by the above code
I used String Build_Number = Build.DISPLAY;
to get Build number as it shown at Phone settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With