LVL - 声明:“如果您没有从市场下载,则完成()”
我需要一个带有“if 条件”的简单语句来执行此操作:“如果您没有从市场下载,则完成()”。 如果我理解得好的话,有两种类型的控制:我需要每次连接到Android Market服务器时都严格进行控制,将数据存储在手机中的任何位置以供进一步离线检查。 一如既往地感谢 Stack 公民!
I need a simple statement with an "if condition" that does this: "if you didn't download from market then finish()".
If I understood well there are two types of control: I need that the control is done strictly everytime connecting to the Android market server, storing data nowhere in the phone for further offline checks.
Thanks, as usual, to the Stack citizens!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该按照应用程序许可开发指南实施许可,并使用StrictPolicy 详细信息参见 政策。
StrictPolicy 不允许缓存响应,我会仔细考虑要求您的用户在线使用您的应用程序是否是一个好主意。
You should implement licensing as per the Application Licensing Dev Guide and use the StrictPolicy detailed under policies.
StrictPolicy does not allow the caching of responses and I would think carefully about whether it is a good idea to demand that your users are online to use your application.
除了 David 建议之外,您还可以观察
ERROR_NOT_MARKET_MANAGED
响应代码。ERROR_NOT_MARKET_MANAGED
— Android Market 无法识别应用程序(包名称)。不要重试许可证检查。可以表明该应用程序不是通过 Android Market 发布的,或者许可实施中存在开发错误。另外,大卫提出了一个很好的观点。应用程序肯定会时常无法与许可服务器进行通信。这可能会让您的用户发疯。
In addition to what David suggested, you could also watch for the
ERROR_NOT_MARKET_MANAGED
response code.ERROR_NOT_MARKET_MANAGED
— the application (package name) was not recognized by Android Market. Do not retry the license check. Can indicate that the application was not published through Android Market or that there is an development error in the licensing implementation.Also, David makes a good point. Apps are guaranteed to fail communicating with the licensing server from time to time. This could drive your users mad.