我有多个设备,我可能会有更多,并且不希望由一个补充它们。有谁知道什么ID Admob的使用?
解决方案 字符串援助= Settings.Secure.getString(的getContext()getContentResolver(),android_id。);
obj对象= NULL;
尝试 {
((消息摘要)(OBJ = MessageDigest.getInstance(MD5)))。更新(
aid.getBytes(),0,aid.length());
OBJ =的String.Format(%032X,新的对象[] {新的BigInteger(1,
((消息摘要)目标文件).digest())});
}赶上(抛出:NoSuchAlgorithmException localNoSuchAlgorithmException){
物镜= aid.substring(0,32);
}
我希望这会帮助你;)
I have multiple devices, and I probably will have more, and do not want to add them one by one. Does anybody know what ID Admob uses?
解决方案String aid = Settings.Secure.getString(getContext().getContentResolver(), "android_id");
Object obj = null;
try {
((MessageDigest) (obj = MessageDigest.getInstance("MD5"))).update(
aid.getBytes(), 0, aid.length());
obj = String.format("%032X", new Object[] { new BigInteger(1,
((MessageDigest) obj).digest()) });
} catch (NoSuchAlgorithmException localNoSuchAlgorithmException) {
obj = aid.substring(0, 32);
}
I hope this will help you ;)
上一篇:轨,ActiveRecord的共享会话ActiveRecord
下一篇:counter_cache has_many_through SQL优化,减少SQL查询的数量数量、counter_cache、SQL、many_through