1.IMEI
Telephonymanager tm= (Telephonymanager) This.getsystemservice (Context.telephony_service); String IMEI = Tm.getdeviceid (); LOG.V ("Ola_log", "IMEI:" + IMEI);
Permissions:
<uses-permission android:name= "Android.permission.READ_PHONE_STATE"/>
Description: The IMEI value of the phone
Cons: Some of the only Wifi tablet, the obtained value is NULL
2.android_id
String android_id = secure.getstring (This.getbasecontext (). Getcontentresolver (), secure.android_id); LOG.V ("Ola_log", "android_id:" + android_id);
Description: Serial number generated when the device first starts
Cons: Online Some people say that some brands will have a duplicate Android ID value, when back to factory settings, theAndroid ID value will change
3.wifi_mac
Wifimanager Wifimanager = (wifimanager) this.getsystemservice (Context.wifi_service); Wifiinfo wifiinfo = Wifimanager.getconnectioninfo (); LOG.V ("Ola_log", "MacAddress:" + wifiinfo.getmacaddress ());
Permissions:
<uses-permission android:name= "Android.permission.ACCESS_WIFI_STATE"/>
Description: Wifi for MAC
Cons: Some brands, no Wifi can not get MAC value
4.build.serial
String buildserial = Android.os.Build.SERIAL; LOG.V ("Ola_log", "buildserial:" + buildserial);
Description: Unique values for hardware
Cons:API 9 is supported later, which is no longer a problem for general devices
5.UUID
String Uuid_value = Uuid.randomuuid (). toString (); LOG.V ("Ola_log", "Uuid_value:" + uuid_value);
Description: Randomuuid can randomly create a unique value, or use other built-in methods to create unique values
(Ex:nameuuidfrombytes (byte[] name)).
Disadvantage: the manufacture and storage of the UUID must be handled, if the use of Randomuuid represents the unique value of the installation
Android Unique values