tags:

views:

306

answers:

8

I've been asked for some review copies of an Android app I've written, which is great, but I'm not willing to give out the full app to just anyone. I want to make a time-limited version (which works for about two weeks, then gives up the ghost).

What is the easiest way to do this? I haven't tested this myself, but I think that in theory if one built the app using a keystore which expires in two weeks might work. Is that correct, or do I have to put a line of code in the app which shuts it down if you attempt to boot it after a set date?

+3  A: 

The keystore is not checked after the application is installed; only at installation time is the date verified.

You would have to put in your own time limit code, I imagine. Though if you want to be really paranoid, you could consider that the user could alter their device's clock.

Alternatively, you could do an online check (against time on your server), or make each APK that you hand out have an individual token embedded which gets validated against your server.

Christopher
Ah, good to know about the keystore check.
Daniel Lew
Interesting story, I was trying to test out the easy solution (a cutoff date in the code) and I actually couldn't change the system time. Sure, Android would let me open a dialog to manually set the date, but some Receiver kept picking it up and changing it back! Perhaps it is not as easy as one thinks to simply "change the time" to keep an app working - or maybe my ADP1 is being a little wonky. :P
Daniel Lew
+1  A: 

easiest way is to hardcode an end date and no longer run after that. it can be circumvented if users change their system time, but that is kind of a hassle to go through.

otherwise, you can have your app check the license periodically by connecting to your server over http, but that requires more work.

jspcal
+1  A: 

This sounds like a great idea. You'd probably want to make the app phone home and verify with a server that a certain amount of time has elapsed. Users can always delete your preferences file on the phone or uninstall and reinstall the app to get around on-phone restrictions.

I believe the keystore approach may also work, but I'm not sure exactly how they work in Android.

Please make this an open source project when you finish - I think this would be useful to a lot of people!

Ben Gotow
+3  A: 

I have a simplest suggestion, what if the reviewer buys the application, and you refund the payment?

Drakosha
+4  A: 

I always just inform people of the Android Market policy that allows them uninstall the app within 24 hours to get a full refund when they request a trial version. Most people aren't aware of this feature, especially people that have switched over from iPhone which has no such feature.

Speaking of which, when does the market switch to the 48 hour refund policy that was in the new developer agreement we had to sign a few months ago?

mbaird
This seems like the easiest solution, though it might be insulting to some reviewers. Also, no idea when the 48 hour refund policy goes into effect.
Daniel Lew
One drawback to this is that, if you uninstall and refund, then decide to purchase again later (perhaps after an update, for example) that purchase is final and cannot be refunded.
GalacticCowboy
A: 

As per Google: "If you plan to publish your application(s) on Android Market, the key you use to sign the application(s) must have a validity period ending after 22 October 2033. The Market server enforces this requirement to ensure that users can seamlessly upgrade Market applications when new versions are available"

What we did with our developer challenge II entry was when we hit the expiration date any new data we processed was replaced by an expiration warning. So the application functioned with existing data but not with any new data the user entered after the expiration. Since our app processed text messages, setting back the clock was an unrealistic long-term solution for the user to overcome the expiration.

fupsduck
A: 

You could use TelephonyManager.getDeviceId() and create a build of your application that would only ever run on the reviewer's phone.

You could either hard code this into the application or have the phone check against your server where you'd store permissions for each Device ID. With the latter case you could have your application display the Device ID when it can't find a license; the reviewer tells you this and then you enter this in your DB.

Dave Webb
A: 

Depending on the type of application your are giving to reviewers, you may have another options.

You code it like a lot of shareware and only let the application run so many times. The code for this would be very easy to implement. Sure the reviewer could delete the data, but not very easily. I don't think they would go through that much trouble for maybe a couple dollars.

Austyn Mahoney