views:

1498

answers:

3

Hello, I have a application which I want to hit the market as a Paid app. I would like to have other version which would be a "trial" version with a time limit of say, 5 days?

How can I go about doing this?

Thanks.

+16  A: 

Currently most developers accomplish this using one of the following 3 techniques.

The first approach is easily circumvented, the first time you run the app save the date/time to a file, database, or shared preferences and every time you run the app after that check to see if the trial period has ended. This is easy to circumvent because uninstalling and reinstalling will allow the user to have another trial period.

The second approach is harder to circumvent, but still circumventable. Use a hard coded time bomb. Basically with this approach you will be hard code an end date for the trial, and all users that download and use the app will stop being able to use the app at the same time. I have used this approach because it is easy to implement and for the most part I just didn't feel like going through the trouble of the third technique. Users can circumvent this by manually changing the date on their phone, but most users won't go through the trouble to do such a thing.

The third technique is the only way that I have heard about to truly be able to accomplish what you want to do. You will have to set up a server, and then whenever your application is started your app sends the phones unique identifier to the server. If the server does not have an entry for that phone id then it makes a new one and notes the time. If the server does have an entry for the phone id then it does a simple check to see if the trial period has expired. It then communicates the results of the trial expiration check back to your application. This approach should not be circumventable, but does require setting up a webserver and such.

It is always good practice to do these checks in the onCreate. If the expiration has ended popup an AlertDialog with a market link to the full version of the app. Only include an "OK" button, and once the user clicks on "OK" make a call to "finish()" to end the activity.

snctln
Fantastic answer. Like you say I feel the second option is possibly the best. Its a shame google themselves don't offer some sort of licensing system as it may encourage both small and bigger brand developers to produce even more android applications.
Tom
Do you need to set up your own server? It seems like the kind of thing someone else would have. This webpage:http://www.nrc-cnrc.gc.ca/eng/services/inms/time-services/network-time.htmlseems to indicate they have a service you could use.
Whaledawg
Also, I wouldn't check during startup. Your goal is to sell the app, not punish the user(that's just a bonus ;) If you have it set to check every 2 minutes while running, you let the user start doing something and then realize they should pay. If you make it really easy to pay and get back to work(I'm not sure if you can in Android) I think you'll sell more then checking during onCreate.
Whaledawg
@Whaledawg: You do need to run your own server because the server is storing the phone id and time of first run in a database that is then compare to laterAlso when you do the check is purely preference of the developer, I used the hard coded time bomb in a game with great results. The whole app would load, but the user can only interact with the dialog that is seen, there is a button on that dialog that takes the user directly to the purchase page for the game. Users don't seem to mind AFAIK since that game has been in the top 10 paid apps since the opening of the Android Market.
snctln
superb answer.. It helps me alot
Vishal
Currently using the first method. It looks like number 2 is not an option if you want to continue getting users to try your app. 3rd is definitely doable, but I will check the usage stats of my trial app to see if a lot of people keep using it longer then the 5 days.
Peterdk
+1  A: 

By definition, all paid Android apps on the market can be evaluated for 24 hours after purchase.

There's an 'Uninstall and Refund' button which changes to 'Uninstall' after 24 hours.

I'd argue this button is way too prominent!

AlexJReid
+4  A: 

Now we have a better solution. Google will keep track of licenses for us!

Licensing Service for Android Application

Poindextrose