private Nested Class DatabaseOpenHelper That Extends SQLiteOpenHelper

The private nested class DatabaseOpenHelper (Fig. 8.58) extends abstract class SQLiteOpenHelper, which helps apps create databases and manage version changes. The constructor (lines 105–109) 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 SQLite CursorFactory (typically for most apps) and

• the database version number (starting from 1).

102   private class DatabaseOpenHelper extends SQLiteOpenHelper103   { ...

Get Android™ How to Program, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.