/** 获取UUID */
public static String getUuid(){
if(uuid == null){
TelephonyManager tm = (TelephonyManager) BaseApplication.getInstance().getSystemService(Context.TELEPHONY_SERVICE);
uuid = StringUtil.md5(tm.getDeviceId().hashCode()+"");
}
return uuid;
}
/** 获取UUID Byte数组 */
public static byte[] getUuidBytes(){
return StringUtil.hexStringToByteArray(getUuid());
}
这只是其中的一种方法,还有很多。
可参考:http://blog.youkuaiyun.com/ljz2009y/article/details/22895297