Question

Possible Duplicate:
Android Trial Applications

I'm trying to create a trial application, which allows the user to use the service for, say, 30 days. Is there a way to keep track of this on the device itself without the user being able to alter or delete the data?

Using SharedPreferences for example would enable the user to remove app data in settings -> applications, or a simple uninstall - install would remove this data.

Was it helpful?

Solution

You can't do this on-device - any data you save can be cleared by the user.

You have 2 options

1 - after 30 days, nag them but accept that they may just clear data to get rid of the nag

2 - implement an online check which tracks UUID generated on their phone (using hardware data they can't easily change)

2 is a lot of work and it means users HAVE to be online to run your App...

OTHER TIPS

Why don't you create a SQLite table just with just one field, increment the counter when a day is changed and udpate the table value.

FYI, here is an excellent article for SQLite in Android.

I don't see how you can do this by keeping data persistant on the phone. The user can always format SD card or restage the phone.

You can encrypt a file and store it on the device. Security thru obscurity. The best be would be a cloud service to monitor installs.

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