Is there a way in android to perform certain actions when "upgrading"
a programm? i.e. deleting all old settings and databases.

For a more practical example, lets assume you have an application you
to sell for a small charge but you also want to offer a free trial
version of it. The trial should expire on a certain date in order to
prevent the user to use it indefinitly a hardcoded date seems most
reasonable and always release new version with new features.

Now to prevent the users to simple reinstall the new version and
continue using the application, it should delete all databases/
settings of the previously installed application, as a small
"motivation" to get the real application for a small fee.

So is there a function, which is called or can be triggered when
installing an application over one already existing application?

For Database one could use the onUpgrade event from SQLiteOpenHelper,
but this would require to increase the database version which i don't
really like to abuse the database versioning for new "Trial versions"
and has some unwanted side effects (i.e. forcing me to increase the
version of the real app too and probably triggering false
notifications about db converting)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to