Using the SQLiteOpenHelper:
SQLiteOpenHelper is an abstract class that wraps up the best practice pattern for creating, opening, and upgrading databases.
By implementing and using an SQLiteOpenHelper, you hide the logic used to decide if a database needs to be created or upgraded before it’s opened.
The code snippet shows how to extend the SQLiteOpenHelper class by overriding the construc-tor, onCreate, and onUpgrade methods to handle the creation of a new database and upgrading to a new version, respectively.
No comments:
Post a Comment