What should the Android device ID length be

25,977

Solution 1

The Android ID is

UP TO 16 characters long

since leading zeroes are not pretended at least in some versions of Android that appear in the wild. Take a look at this answer to a similar question for why that is: https://stackoverflow.com/a/29890124/2066744

The docs specify it as a 64-bit number (expressed as a hexadecimal string) here: https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID

Solution 2

i have two device using this code

String device_id =  Secure.getString(getContentResolver(), Secure.ANDROID_ID);
Share:
25,977
SampathKumar
Author by

SampathKumar

Senior iphone developer

Updated on July 26, 2022

Comments

  • SampathKumar
    SampathKumar almost 2 years

    Can anybody please tell me the length for device UDID in Android, because I got the UDID in android and it is only 16 characters, but the iPhone UDID length is 40.

    I am using the following code to detect the ID:

    id = android.provider.Settings.System.getString(super.getContentResolver(),
        android.provider.Settings.Secure.ANDROID_ID);