i have created an application and would like to provide a 30 days trial period for the 开发者_如何转开发same using licensing dll provided by android (http://developer.android.com/guide/publishing/licensing.html#support),but i cannot find how to restrict this licensing to 30 days from date of installation.
Thanks in advance.
I haven't used the licensing library yet, but my understanding is this is one of the major gripes/flaws about the setup in general. Since only paid applications can use the service, you really can't implement a trial period for a paid app.
The licensing portion, does just that, licenses the application. If the application is able to obtain a license from the server, then it's free to run indefinetly...or until the application code is triggered to do the check again. There is no check at the server that has anything to do with timing. Since John Q app user paid for the app, he expects he will always be able to obtain a license.
You could build your own custom methods to do time checks via shared prefs using the install or first time the application was run, but all someone has to do is delete the app and re-install it.
Essentially, I believe this is a big portion of why there are so many sets of the same application in the market place. "Sets," referring to a lite/trial/full/beta/eval version of the same app.
精彩评论