Package com.google.android.exoplayer2.database

## Class ExoDatabaseProvider

- java.lang.Object
- - android.database.sqlite.SQLiteOpenHelper
  - - com.google.android.exoplayer2.database.ExoDatabaseProvider

- All Implemented Interfaces:
    `DatabaseProvider`, `AutoCloseable`

      public final class ExoDatabaseProvider
      extends SQLiteOpenHelper
      implements DatabaseProvider

  An `SQLiteOpenHelper` that provides instances of a standalone ExoPlayer database.

  Suitable for use by applications that do not already have their own database, or that would prefer to keep ExoPlayer tables isolated in their own database. Other applications should prefer to use `DefaultDatabaseProvider` with their own `SQLiteOpenHelper`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `DATABASE_NAME` | The file name used for the standalone ExoPlayer database.

    - ### Fields inherited from interface com.google.android.exoplayer2.database.DatabaseProvider

      `TABLE_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ExoDatabaseProvider​(Context context)` | Provides instances of the database located by passing `DATABASE_NAME` to `Context.getDatabasePath(String)`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onCreate​(SQLiteDatabase db)` |
    `void` | `onDowngrade​(SQLiteDatabase db, int oldVersion, int newVersion)` |
    `void` | `onUpgrade​(SQLiteDatabase db, int oldVersion, int newVersion)` |

    - ### Methods inherited from class android.database.sqlite.SQLiteOpenHelper

      `close, getDatabaseName, getReadableDatabase, getWritableDatabase, onConfigure, onOpen, setIdleConnectionTimeout, setLookasideConfig, setOpenParams, setWriteAheadLoggingEnabled`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.android.exoplayer2.database.DatabaseProvider

      `getReadableDatabase, getWritableDatabase`

- - ### Field Detail

    - #### DATABASE_NAME

          public static final String DATABASE_NAME

      The file name used for the standalone ExoPlayer database.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ExoDatabaseProvider

          public ExoDatabaseProvider​(Context context)

      Provides instances of the database located by passing `DATABASE_NAME` to `Context.getDatabasePath(String)`.
      Parameters:
        `context` - Any context.

  - ### Method Detail

    - #### onCreate

          public void onCreate​(SQLiteDatabase db)

      Specified by:
        `onCreate` in class `SQLiteOpenHelper`

    - #### onUpgrade

          public void onUpgrade​(SQLiteDatabase db,
                                int oldVersion,
                                int newVersion)

      Specified by:
        `onUpgrade` in class `SQLiteOpenHelper`

    - #### onDowngrade

          public void onDowngrade​(SQLiteDatabase db,
                                  int oldVersion,
                                  int newVersion)

      Overrides:
        `onDowngrade` in class `SQLiteOpenHelper`