title: Android ID as an alternative to Device ID
body: <p>My apps have always used DeviceId as a unique identifier and this, of course, requires READ_PHONE_STATE as a permission.  That has been ok in the past but now I have migrated to Marshmellow 23 where asking for this permission displays a very scary dialog at run time saying...</p>
  
  <p>"Allow {my app} to make and manage phone calls?"</p>
  
  <p>That's a pretty hideous message for an app that just wants to get deviceId.</p>
  
  <p>I'm thinking of switching over to Android ID as it doesn't require any permission.</p>
  
  <pre><code>String androidId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
  </code></pre>
  
  <p>Googling around I see there have been some problems using android ID but it's all old stuff.  Back in Froyo days there was a phone vendor that produced the same ID for all of their phones but that's about all I have seen.</p>
  
  <p>Is anyone aware of any problems using Android ID?
  Thanks,
  Dean</p>