import android.telephony.TelephonyManager; //pengyingh 15 8 25 get uuid
import java.util.UUID; //pengyingh 15 8 25 get uuid
import android.content.Context; //pengyingh 15 8 25 get uuid
public class CommonFunc {
public static String getUniqueID(){
final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
String uniqueId = deviceUuid.toString();
System.out.println("获取uniqueID:"+uniqueId);
return uniqueId;
}
}