Unique ID of Android device

There are three types of identifier on android phone.

  1. IMEI
  2. IMSI

    String ts = Context.TELEPHONY_SERVICE;
    TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ts);
    String imsi = mTelephonyMgr.getSubscriberId();
    String imei = mTelephonyMgr.getDeviceId();
    
  3. Android ID
    It is a 64-bit hex string which is generated on the device’s first boot.
    Generally it won’t be changed unless is factory reset.

    Secure.getString(getContentResolver(), Secure.ANDROID_ID);
    

Leave a Comment