Helal Khan
Helal Khan

Reputation: 895

Android Device UDID or unique ID?

I want to generate android device unique id for my android application to create favourite according to user device udid.

Upvotes: 7

Views: 30598

Answers (3)

Ahsan Idrees
Ahsan Idrees

Reputation: 11

You can use different values as udid. The above mentioned Secure.ANDROID_ID has some cons It can be null It is same on 2.2 and some 4.2 devices You can use MacAddress of device or IMIE address(Can be null on devices without cellular connection)

Upvotes: 0

Farruh Habibullaev
Farruh Habibullaev

Reputation: 2392

private String uDiD = Secure.getString(getContext().getContentResolver(),
                                                        Secure.ANDROID_ID); 

Upvotes: 0

Daniel
Daniel

Reputation: 1545

All devices have a unique id.

 import android.provider.Settings.Secure;
 private String android_id = Secure.getString(getContext().getContentResolver(),
                                                            Secure.ANDROID_ID); 

Upvotes: 19

Related Questions