I've released a "Lite" version of an app that I want to then sell the "pro" "upgrade" for - without having to release a totally new version.
My thought was to create a liste开发者_如何学JAVAner that would listen for an intent from the main application, triggering it to query the license service for itself and return to the original application the results. That way you install the trial and buy the "pro" license file essentially without having to reinstall or lose your data from the original install.
I started the license "listener" app which is not going to have it's own activity. Unfortunately I found that code I've used before to access the license service won't work because I'm trying to run it inside a listener - but getContentResolver() doesn't exist for a listener.
Am I even going down the right road with this approach or is there an easier way?
I used it in a ContentProvider so I assume you can use it in anything else.
If you have a broadcast receiver though, it might be difficult because the life cycle of a broadcast receiver.
You could sell the "license pack" as a separate service or broadcast receiver, and it can perform the authentication on request.
精彩评论