package com.example.database4

import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
//android has its own file system.  And your app has a folder dedicated to the storing of its stuff.  We are going into that directory, going into a subfolder
//called "databases" and opening up movies.db contained therin.
class MovieDBHelper: SQLiteOpenHelper (MovieActivity.mContext,MovieActivity.mContext!!.applicationInfo.dataDir+"/databases/movies.db",null,1) {
    override fun onCreate(p0: SQLiteDatabase?) {
    }

    override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
    }
}

//When you use an SQLite database, you need a "helper" this class inherits from SQLiteOpenHelper, notice that it is not even overriding
//the methods with any meaningful code.  onCreate and onUpgrade are blank.  But what it is doing is creating
//an SQLiteHelper with information directly pertaining to this program.  We are passing in the "context" of it
//being part of MovieActivity and we're passing the filename of the database itself.