SQLite Database (Single Table)
At the center of the SQLite database are your tables holding the data. You do not directly access the data in the tables -- data is inserted into the database via ContentValue objects, and data is pulled from the database via Cursor objects:
This example will create a database containing information about movies. The main activity of the app is MovieActivity. The major components of the app are:
- MovieActivity class
- MovieDB class that coordinates the use of the database (references to database and database helper objects, and lots of useful methods for accessing the database).
- SQLiteDatabase
- DBHelper
A visualization of this structure is shown below:
Information is pulled from the database via a Cursor object
Information is put into the database via a ContentValues object:
See the Java classes and the layout XML for the Movie app.