How do I programmatically access the value shown in the image below ?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is the hardware serial number. To access it on
Android Q (>= SDK 29)
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATEis required. Only system apps can require this permission. If the calling package is the device or profile owner then theREAD_PHONE_STATEpermission suffices.Android 8 and later (>= SDK 26) use
android.os.Build.getSerial()which requires the dangerous permission READ_PHONE_STATE. Usingandroid.os.Build.SERIALreturns android.os.Build.UNKNOWN.Android 7.1 and earlier (<= SDK 25) and earlier
android.os.Build.SERIALdoes return a valid serial.It’s unique for any device. If you are looking for possibilities on how to get/use a unique device id you should read here.
For a solution involving reflection without requiring a permission see this answer.