Can someone please explain me how to retrieve the device ID which is unique? Is there a built in function for this in Android?
You can use Settings.Secure#ANDROID_ID to retrieve the Android ID as an unique 64-bit hex string.
private String android_id = Secure.getString(getContext().getContentResolver(),Secure.ANDROID_ID);
It looks like you're new here. If you want to get involved, click one of these buttons!