We can see that the DatabaseHelper class is extended from SQLiteOpenHelper. The below statement instantiates an object of the SQLiteOpenHelper class and calls its constructor. These functions are available in the super SQLiteOpenHelper class. It will be called whenever there is a first call to getReadableDatabase( ) or getWritableDatabase( ) function. It is called only once throughout the entire application lifecycle. ![]() The onCreate( ) is called when the database is created for the first time. These classes take care of opening the database if it exists, creating it if it does not, and upgrading it as necessary. In this class, we will implement two overridden methods onCreate( ) and onUpgrade( ). We need to create a subclass extending from SQLiteOpenHelper class for database manipulations. The helper class manages the creation of the database, handling database manipulations, and also the version management. It is a helper class to manage SQLite database creation and version management. SQLiteOpenHelper is an in-built class of package. The package consists of all the APIs to perform CRUD operations from our android application. It carries lightweight data and does not require any administration or setup procedure of the database. ![]() SQLite is built into all mobile phones and most computers and comes bundled inside. ![]() A complete SQLite database with many tables, triggers, indices, and views is contained in a single disk file. SQLite does not run on a database server, but stores all its data in simple files. Android includes a SQLite library in its standard library that implements a serverless, zero-configuration, and transactional SQL database engine. SQLite is an open-source relational database, similar to MySQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |