http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onUpgrade%28android.database.sqlite.SQLiteDatabase,%20int,%20int%29
Every tutorial I've seen on Android SQLite has mentioned this. On May 27, 5:32 am, Pranav <vips...@gmail.com> wrote: > Hi all, > > I have created a database file(myapp.db) using SQLite Browser and i am > accessing it from assets/ folder in my project. The application has > more than 25 tables and each table contains more than 20 fields. The > application sends request to the server and get the response in the > form of JSON string. All the data will be stored in the phone database > from the response string. > > As per the above, i need to do. > Question: If i get change in database, which is the best way to > upgrade database version without loosing stored data? > > The data will be stored permanently in the application and if there is > any change in database, i need to keep the data in application. If i > uninstall the application, the data will be lost. > > Technically, when the application runs first time, the database schema > file(myapp.db) will be copied in the application. Whenever the > application run, it will check for the existing database which is > exists or not. If it is not, it will copy from the assets/ folder > otherwise it will not perform any action and simply ready to use it. > > Please provide me any suggestions or guidance or example to do so. > > Your help would be greatly appreciate. > > Thanks. > > Pranav -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en