Android的LVL(Licensing服务)是难以置信的慢! - 解决方案?异步? [英] Android LVL (Licensing service) is incredibly slow! -- solutions? Async?

查看:185
本文介绍了Android的LVL(Licensing服务)是难以置信的慢! - 解决方案?异步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我环顾四周,并在网上看到了一些其他职位抱怨Android的许可(LVL)库是如何缓慢,但没有解决办法。在一个HTC霹雳(全新的手机),它由3-5 +秒延迟一个测试应用程序的启动时间。

I looked around online and saw some other posts complaining about how the Android licensing (LVL) library is slow, but no solutions. On an HTC Thunderbolt (brand new phone) it delays the startup time of a test app by 3-5+ seconds.

有没有人对异步调用这个库中的任何经验或想法?其他解决方案?我只是用基本提供的示例code。真正讨厌的部分是整个应用程序被冻结,而这个简单的许可检查时,这是非常糟糕的。

Does anyone have any experience or ideas on calling this library asynchronously? Other solutions? I am just using the sample code provided basically. The really annoying part is that the whole app is frozen while this simple license check occurs, it's really bad.

谢谢!

推荐答案

傻子想通了:在licenseCheck是异步

Nitwit figured it out: the licenseCheck is asynchronous.

所以刚启动它,然后用code你接下来的几行打开应用程序,而当响应到达时,将中断应用程序(例如,如果你设置了那里是一个对话框,若许可证不是有效的,那么你的应用程序将开始加载,然后出现的对话框,这一切的块)。

So just fire it, then open the app with your next few lines of code, and when the response arrives, that will interrupt the app (i.e. if you set up for there to be a dialog if the license is not valid, then your app will start to load and then the dialog appears and this blocks everything).

请务必在一个不允许的情况下面所有code的后续精加工()。

Make sure to include finish() in the follow-up of all code that follows on a "don't allow" situation.

大的结果:应用程序失去四五秒的加载时间

Great results: the app loses four or five seconds in load time.

这篇关于Android的LVL(Licensing服务)是难以置信的慢! - 解决方案?异步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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