Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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".

like image 932
Amit kumar Avatar asked Dec 20 '13 05:12

Amit kumar


People also ask

How do I find my Build number Android?

The build number is reported in Settings > About phone. For Android Oreo, it is shown in Settings > System > About phone.

How can I find my serial number in Android programmatically?

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.

How do I find my AOSP version?

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).

Is Android build number unique?

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.


2 Answers

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

like image 125
SilentKiller Avatar answered Sep 25 '22 16:09

SilentKiller


I used String Build_Number = Build.DISPLAY; to get Build number as it shown at Phone settings

like image 32
Nur El-din Avatar answered Sep 23 '22 16:09

Nur El-din