Question

I'm evaluating different ways to build and market an Android app using the freemium model. I would like to restrict the functionality of the app in one or more ways to encourage purchases of the premium version.

Are there proven, secure coding techniques for limiting functionality such as:

1) maximum number of uses per day,

2) maximum number of calls to a key method per day (or other time period),

3) app is disabled after a period of usage (e.g. 1 month) and cannot be circumvented through simple uninstall/re-install.

-> One thought is to hash a value that is stored somewhere in app or supporting files (e.g. resource, manifest) that tracks usage and cannot be simply overwritten to circumvent restrictions.

-> A more complex approach would be registering the install at a web service and then have the web service enable/disable operation based on tracking data, however, if the web-service goes down, this could disable this function (e.g. default to operational would allow the app to run if the service is not available).

Was it helpful?

Solution

Number 1 and 2 can be easily done, but can be circumvented if the user changes the system time on the device (hello Candy Crush). To prevent that you'd need to register to receive ACTION_TIME_CHANGED and perhaps ACTION_TIMEZONE_CHANGED and figure out how to react accordingly. Alternatively, you could obtain time from an external source, but that would increase the network needs of your app.

When an app is uninstalled, all of its internal files are deleted, so the first part of number 3 won't work. You could put the that flag file in external storage, but a minimally savvy user could easily find and delete it, unless you were crafty with the name and or permissions. But that's not really playing fair since the file would exist long after a user decided they didn't want your app anymore. The only reliable way to handle number 3 and have it survive reinstalls is to do as you suggested and use some sort of web based registration process.

A far better approach is probably to use Google Play Licensing. It allows try-before-you-buy and other approaches.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top