1.使用ANDROID_ID
import android . provider . Settings . Secure ;
private String android_id = Secure . getString ( getContext (). getContentResolver (),
Secure . ANDROID_ID );
这个值应该是在系统第一次启动后计算出来的,设备恢复出厂设置之后,再次启动这个值可能会改变。
2.2版本的会有问题。
2.使用wifi网卡mac地址
WifiManager wm = ( WifiManager ) Ctxt . getSystemService ( Context . WIFI_SERVICE );
wm . getConnectionInfo (). getMacAddress ();
3.Device ID
String deviceId = (( TelephonyManager ) context . getSystemService ( Context . TELEPHONY_SERVICE )). getDeviceId ();
|