java – What is the difference between SQLiteOpenHelper and SQLiteDatabase?


I started trying to work with a database and this question turned out)

I surfed a little and, as far as I understood, SQLiteOpenHelper extends SQLiteDatabase , but even there … But since I SQLiteOpenHelper understanding this for only an hour, I decided to find out what for what?


For work, you will most likely need SQLiteOpenHelper , since SQLiteDatabase final class. In the class that inherits from SQLiteOpenHelper you will override the onCreate() and onUpgrade() methods.

In onCreate() – you create a table in the DB. In onUpgrade() – you can change the version of the database if, for example, you have added new models to the database.

Well this is so … short!

Scroll to Top