9.7 AddressBookDatabaseHelper Class

The AddressBookDatabaseHelper class (Fig. 9.17) extends abstract class SQLiteOpenHelper, which helps apps create databases and manage database version changes.

Fig. 9.17 AddressBookDatabaseHelper subclass of SQLiteOpenHelper defines the app’s database

Computer code. The code has 41 lines.

Constructor

The constructor (lines 16–18) simply calls the superclass constructor, which requires four arguments:

  • the Context in which the database is being created or opened,

  • the database name—this can be null if you wish to use an in-memory database,

  • the CursorFactory to use—null indicates that you wish to use the default ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.