title: Get hardware serial number of Android device
body: <p>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 <code>Settings &gt; About Device &gt; Status &gt; Serial number</code>.</p>
  
  <p>I though I would get it using <code>Settings.Secure.ANDROID_ID or android.os.Build.SERIAL</code>, but neither of them worked, meaning that they didn't give me unique identifier I'm looking for. For instance <code>android.os.Build.SERIAL</code> got me the unique ID shown on ADB when you run the command <strong>adb devices</strong>.</p>
  
  <p>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. </p>
  
  <p>Thanks for the help.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>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.</p>
  
  <p>I have a Samsung device, therefore, the serial number they used is different than the one provided by android.os.BUILD.SERIAL.</p>