I am developing an app where i have to update my data base when user selects app upgrade process. Simply i want to do a database changes when my app is migrated to new version.
How to do this job please suggest.
AND
I am developing an app to which already have some versions in market now i want to release an update to my app but i haven’t got any info how to do it. Is it like a normal apk file creation?? if it is then do i need to use any adb commands to test this apk file?? Please Suggest..!!!
Thanks,
Ram.
Please see this doc for information on SQLiteOpenHelper. It provides the functionality for you to do updates, and onCreates (when db is created).
The way the onUpgrade method should work is that you pass it the db, the old version number, and the new version number, so you can do comparisons of that. You would do something like this:
The version number is generally stored as a class level variable somewhere either in your SQLiteOpenHelper or your main database helper.
This will require a restart of your application. If you are referring to the ability of a user to do an in-app upgrade then this might not work for you.