如果获取一个设备的唯一的一个标识
不一定是手机,有可能是平板电脑
------解决方案--------------------
- Java code
Settings.Secure.getString(this.getContentResolver(), Settings.System.ANDROID_ID);
------解决方案--------------------
public String getId() {
String id = android.provider.Settings.System.getString(super.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
return id;
}
------解决方案--------------------
TelephonyManager tm = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
String deviceId = tm.getDeviceId();
------解决方案--------------------