开发者

How could I use the Android LVL in my premium key app?

It seems that the commonly accepted approach to implement a paid "premium key" application is to have a the free app check if the paid one is installed to unlock features. This part is straight forwar开发者_运维问答d as is the implementation of the LVL but I cannot figure out how to combine both. If the paid app is never intended to be run, there is no way to call the License Verification Service. Only way I could think of was to have the free app invoke an intent from the paid one and wait for a response. The paid app could do the license verification. Problem with this approach is that when the free app calls the intent, it is paused and can be killed anytime by the OS. So nothing guarantees that the app is still running after the license check.

Any ideas or suggestions on how to implement a paid app that would only be an unlock key but also implements the LVL?

Thank you


I don't see a problem as well doing it with via a service, as NickT suggested.

The other option I see might be doing it by 'abusing' a content provider. The query on the content provider might block while the license is being verified, so you need to query it asynchronously and e.g. display some kind of busy spinner in the main activity.

Both approaches seem to be easier to me than spawning another activity via an intent (that was the initial approach, right?).


One way of implementing a free and an enhanced version would be to split the functionality across two separate apks. The free version would be packaged as a number of normal activities, the enhanced version's functionality would be implemented by a remote service in a separate apk.

The two communicate via a remote interface using AIDL. On start up the free app attempts to bind to the service and times out if it can't. If a connection is made a static property in the free app is set to true. The free application tests this property before any routine that gives enhanced functionality is called.

I've done this but not released it on the market yet and don't know anything about the LVS, but don't see why the service apk couldn't perform this function and implement a method such as 'licenceVerified()' which could return the results to the free app via AIDL. In my project the service actually does a lot of other computation which returns information to the free part, so even if the free part was hacked, then unless the service apk was actually present, the free app would crash if a non existent method on the remote interface was called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜