How to get the unique Android device ID?

Can someone please explain me how to retrieve the device ID which is unique? Is there a built in function for this in Android?

Comments

  • DavidMDavidM USA
    edited February 2014

    You can use Settings.Secure#ANDROID_ID to retrieve the Android ID as an unique 64-bit hex string.

    import android.provider.Settings.Secure;
    private String android_id = Secure.getString(getContext().getContentResolver(),Secure.ANDROID_ID); 
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion