I need to get the hardware serial code of Android device where my app is installed. This hardware serial number is the one that you can see on Settings > About Device > Status > Serial number
.
I though I would get it using Settings.Secure.ANDROID_ID or android.os.Build.SERIAL
, but neither of them worked, meaning that they didn't give me unique identifier I'm looking for. For instance android.os.Build.SERIAL
got me the unique ID shown on ADB when you run the command adb devices.
Notice that the goal of this question is not to find another unique identifier that could help me, it's only about getting the device hardware serial number.
Thanks for the help.
EDIT:
Please be clear that I'm not looking for the value provided by the String android.os.BUILD.SERIAL. I know how to get that value but I'm not interested in it.
I have a Samsung device, therefore, the serial number they used is different than the one provided by android.os.BUILD.SERIAL.