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 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.