How to get Serial number of Android device programmatically

Arslan Tazhibaev picture Arslan Tazhibaev · Apr 27, 2018 · Viewed 10.2k times · Source

How to find the serial number of the device with Android. I need a serial number that is in About device -> Status -> Serial number

Build.Serial returns to me a different value

enter image description here

Answer

theanilpaudel picture theanilpaudel · Apr 27, 2018

Use this upto Android 7.1(SDK 25)

Build.SERIAL

And this for Android 8(SDK 26+)

Build.getSerial()