UDID还是IMEI-更好? [英] UDID or IMEI- which is better?

查看:224
本文介绍了UDID还是IMEI-更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当开发需要我唯一识别电话用户的应用程序时。我希望一些建议,是否最好使用手机的UDID或IMEI。使用任何优点/缺点。非常感谢所有评论。

解决方案

ANDROID_ID的优点:


  1. Settings.Secure.ANDROID_ID。这是设备首次启动时生成和存储的64位数( ANDROID_ID 对于Android 2.2和4.2不是唯一的)

缺少ANDROID_ID:



  1. ANDROID_ID 可以 null



  2. 几个制造商的几个设备受到2.2中的 ANDROID_ID 错误的影响,并且它们都具有相同的 ANDROID_ID ,即 9774d56d682e549c 。这也是模拟器报告的同一设备ID



    文档: http://android-developers.blogspot.in/2011/03/identifying-app-installations.html


  3. ANDROID_ID 不再唯一标识设备: http://stackoverflow.com/a/13465373/150016


IMEI


  1. IMEI < a>数字始终是唯一的。

缺少IMEI


  1. 许多设备没有IMEI号码,即三星Galaxy Tab 2

重要链接




When developing an app that requires me to uniquely identify phone users. I was hoping for some advice on whether it is best to use a phone's UDID or IMEI. Are there any advantages/disadvantages to using either. All comments would be greatly appreciated

解决方案

Pros of ANDROID_ID:

  1. Settings.Secure.ANDROID_ID. This is a 64-bit quantity that is generated and stored when the device first boots (ANDROID_ID is not unique for android 2.2 and from 4.2)

Cons of ANDROID_ID:

  1. ANDROID_ID can change on factory reset.

  2. ANDROID_ID can be null

  3. It can be easily changed on a rooted phone

  4. Several devices by several manufacturers are affected by the ANDROID_ID bug in 2.2 and all of them have the same ANDROID_ID, which is 9774d56d682e549c. Which is also the same device id reported by the emulator

    Docs: http://android-developers.blogspot.in/2011/03/identifying-app-installations.html

  5. ANDROID_ID no longer uniquely identifies a device: http://stackoverflow.com/a/13465373/150016

Pros of IMEI

  1. IMEI number is always unique.

Cons of IMEI

  1. Many device don't have IMEI number i.e Samsung galaxy tab 2

Important Links

这篇关于UDID还是IMEI-更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆