We define a DBManager class to perform all database CRUD(Create, Read, Update and Delete) operations. Hence we can figure out the best way to convert the database from the old schema to the new one.
For that we’ll need to create a custom subclass of SQLiteOpenHelper implementing at least the following three methods. Konsep Dasar Database SQLite pada Android.
SQLiteOpenHelper wraps up these logic to create and upgrade a database as per our specifications. We will have option to alter the database schema to match the needs of the rest of the app. When the application is upgraded to a newer schema – Our database will still be on the old schema from the older edition of the app.So we will have to create the tables, indexes, starter data, and so on. When the application runs the first time – At this point, we do not yet have a database.SQLiteOpenHelper is designed to get rid of two very common problems.