Android 设备可以开始为设备 ID 提供 null 值吗?
我在市场上有一个应用程序。当您开始玩游戏时,您的设备 ID 会链接到您的帐户,因此您无需手动登录。一段时间以来,一些人遇到了问题。他们开始登录不同的帐户。问题似乎是某些设备在询问设备 ID 时给出空值。由于一些帐户的设备 ID 为空,人们会登录到不同的帐户。
我读到有些设备可以做到这一点。不过创建账号然后玩一段时间好像没有问题。
我知道这不是最好的方法,谷歌不鼓励使用设备 ID,因为它们可以在结构重置时更改。
设备是否会因某种原因停止提供其 ID(除了结构重置之外)? 有人知道一种无需输入登录名或密码即可识别用户身份的不同方法吗?
I have an app on the market. When you start playing your device id is linked to your account so you don't have to log in manually. For some time now a few people had a problem. They started logging in into different accounts. What seems to be the problem is that some devices give a null value when asked for device id. With a few accounts with a null device id, people were logging into different accounts.
I read that some devices will do that. But it seems that there was no problem during account creation and then playing for a while.
I know this is not the best method and google discourages using device ids since they can change on fabric reset.
Can a device for some reason stop giving its id(besides the fabric reset)?
Anyone know of a different way to identify the user with out him needing to put in a login or password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,有些手机存在错误,它们会为 Android ID 返回 NULL。我认为如果你想继续使用它们,你总是需要一种方法将手机与帐户、电子邮件、用户名绑定。这样,如果 Android ID 无法识别,他们可以使用电子邮件或用户名和密码登录以再次关联它们。当有人购买了新手机并且需要一种方法来恢复他们的帐户(如果您不这样做)时,您总会遇到问题。
更好的选择是每部 Android 手机都附加一个 Google 帐户。使用 AccountManager 类,您可以使用这些凭据自动对您的软件进行身份验证,并且用户无需输入用户名/密码。你集中了他们的身份。此外,使用此方法,您不需要额外的权限来读取也存在潜在安全问题的数据。
Yes some phones have bugs in them where they will return NULL for Android ID. I think if you want to continue to use them you'll always need a way to tie that handset to an account, email, username. That way if the Android ID is unrecognized they could login using their email or username, and password to associate them again. You'll always have issues where someone buys a new phone and needs a way recover their account if you don't.
A better option is every Android phone is attached to a Google account. And using the AccountManager class you can use those credentials to authenticate to your software automatically and the user doesn't have to enter username/password. And you'e centralized their identity. Also with this method you don't require the extra permissions to read data that has potential security issues too.
您可以在用户安装您的应用程序后创建一个随机 UUID。
不要使用硬件 ID,因为并非每种类型的硬件都可以在每种类型的 Android 设备中找到。不使用它们的另一个原因是,如果有人出售他的手机,用户会发生变化,但设备 ID 不会!这会对隐私和可用性造成严重影响,您不希望出现这种情况。
请参阅演讲 Android 专业提示(来自 google io 2011)。请在 15:00 收听,了解更多原因以及如何在您的用例中使用随机 UUID 的详细说明。
You could create a random UUID after the user has installed your app.
Do not use hardware ids, because not every type of hardware is found in every type of Android device. Another reason not to use them is, if someone sells his phone, the user changes but the device id not! This has serious privacy and usability implications you do not want to have.
See the talk Android Protips (from google io 2011). Tune in at 15:00 to see more reasons and a detailed descriptions on how to use random UUIDs for your usecase.
我面临同样的问题在我的情况下,当第一次安装应用程序时,它给出 null id 。但之后它给了我所有三个 IMEI、ANDROID_ID 和 deviceID。
顺便说一句,您可以在此处找到识别设备的方法
http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=1&cntsId=9640
I am facing the same problem In my case when first install the app it is giving null id . but after that it is giving me all three IMEI, ANDROID_ID and deviceID.
BTW, you can find the ways to identify the devices here
http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=1&cntsId=9640
此外,一些研究原型试图阻止手机收集这些信息。
Also some research prototypes try to prevent phones from collecting this information.