SQLite is a built-in database in Android, SQLite is a lightweight database, supports standard SQL syntax, and supports acid things.
The Sqliteopenhelper class is available in Android to help us use SQLite. SQLite is an abstract class with two abstract methods, namely onCreate () and Onupgrade (), which we must rewrite. There are also two very important example methods in Sqliteopenhelper, Getreadabledatabase () and Getwritabledatabase (). Both of these methods can create or open an existing database (open directly if the database already exists, otherwise create a new database) and return an object that can read and write to the database. The difference is that when the database is not writable (such as disk space is full) the object returned by the Getreadabledatabase () method will open the database in a read-only manner, and the Getwritabledatabase () method will have an exception.
There are two construction methods in Sqliteopenhelper that can be overridden. The general selection of the parameters of the few to rewrite. The first parameter is the context, the second parameter is the name of the database, the third parameter is the cursor of its own definition, generally we are descendants of NULL, and the fourth is the version number of the current database.
Use of SQLite in Android