Skip to content

Instantly share code, notes, and snippets.

@layerlre
Created November 27, 2016 06:07
Show Gist options
  • Save layerlre/4bcff7fd90380d64176046f6640d7214 to your computer and use it in GitHub Desktop.
Save layerlre/4bcff7fd90380d64176046f6640d7214 to your computer and use it in GitHub Desktop.
Get device IMEI and device ID
...
// GET DEVICE ID
final String deviceId = Secure.getString(getContentResolver(),
Secure.ANDROID_ID);
// GET IMEI NUMBER
TelephonyManager tManager = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);
String deviceIMEI = tManager.getDeviceId();
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment