Android 应用程序唯一许可证密钥
我正在开发一个移动应用程序,需要使用网络服务与网站不断交互。为此,我计划拥有某种唯一的移动 ID,该 ID 可以在用户下载应用程序时生成。这个唯一的 ID 将用于从移动设备登录网站,并且可以在用户提交任何评论或与服务器同步时发送以进行验证。
是否可以为每次下载生成某种唯一的许可证密钥?同时,将该唯一密钥传递给网站以供用户移动注册。 Android 市场是否提供此功能,如果是,那么如何提供?
平均值, 萨潘
I am developing a mobile app which would need constant interaction with the web site using web service. For this purpose I am planning to have some kind of unique mobile ID which can be generated at the time of application download by the user. This unique ID will be used for website login from mobile and can be sent for validation when user submits any reviews or syncs with the server.
Is it possible to generate some kind of unique license key for each download? And at the same time, pass on that unique key to the web site for user mobile registration. Does android market provides this facility ans if yes, then how?
Rgds,
Sapan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有一个官方授权平台,您看过吗?
There is an official licensing platform, have you taken a look at that?
好主意,即使我也在为我的 Android 应用程序考虑同样的概念,这样人们就不能免费或以较低的价格出售下载的应用程序。
我想建议您可以使用唯一的组合密钥(由两个属性组成:电话号码和他的电子邮件 ID)来注册用户。
问候
卡兰吉特·辛格
Nice thought,even i was thinking the same concept for my android application so that people can't sell the downloaded app for free or at lower rates.
one thing i would like suggest you can register the user with a unique composed key(made up of two attributs:phone number and his email-ID).
regards
karanjit singh
您可以在用户首次登录时在注册过程中生成一个唯一的 ID。您可以使用 uniqid 函数为该用户生成唯一的 ID。然后将唯一 ID 与用户凭据一起存储在数据库中。
You can generate a unique ID when the user first logins in during the registration process. You can use the uniqid function to generate a unique id for that user. Then store the unique id in a database along with the users credentials.
如果您希望这是无缝的并且在幕后进行,不需要任何用户交互,请谷歌搜索“UUID”。有很多算法可以实现这一点,所以我不会在这里深入讨论。但我使用了时间戳+极大随机数实现,到目前为止它运行得很好。当应用程序运行时,我测试它是否存在于
SharedPreferences
中,如果不存在,我创建它,并将其保存在其中。请注意
Secure.AndroidID。
它不可靠除非您的应用程序仅在 2.3+ 上运行,否则是唯一的。另请记住,不要尝试使用 IMEI 或其他此类信息,因为虽然对于拥有该信息的手机来说是唯一的,但对于 verizon 手机和非 3g 平板电脑则不可用
If you intend this to be seamless and behind the scenes, not requiring any user interaction, google for "UUID". There are many algorithms for implementing this, so I really won't get into it too deep here. But I have used a timestamped+extremely large random number implementation and it is working quite well so far. When the app runs, i test if it exists in the
SharedPreferences
, if not, i create it, and save it in.BEWARE of
Secure.AndroidID.
it is not reliably unique unless your app ONLY runs on 2.3+.Also remember to not try to use IMEI or other such information, because while unique for handsets that have it, is unavailable for verizon mobiles, and non-3g tablets