Android uses the SQLiteOpenHelper class to provide the heavy lifting of creating and updating SQLite databases. Learn how to take advantage of this functionality in this video.
- [Voiceover] Once we have the constants…for our tables and columns to find in a contract class,…we can begin to take advantage of them elsewhere.…Therefore let's create a SQLite open helper class.…This class is useful because it does the heavy lifting…of creating and updating the database only when needed.…We're going to create it here inside of our db package.…So we can come over to the db package…and I'm going to right-click and go to new, Java class.…
And we're going to name it Database…SQLite open helper,…and click on okay.…The first thing we need to do is make sure…it extends the SQLite open helper class.…We can do that by typing extends,…and then SQLiteOpenHelper.…We're going to receive a few warnings from Android Studio.…
And if we mouse over the red line,…you'll see that it gives us a warning…that the database SQLite open helper class…must either be declared abstract…or implement abstract method on create.…So let's go ahead and use the Android Studio shortcut…in order to do this.…So, ALT enter, and we're going to choose implement methods.…
To begin, Annyce Davis reviews using the de facto data persistence solution available on Android: SQLite. She takes you through basic SQLite concepts—such as how to create a database wrapper and insert data into a table—as well as a few more advanced topics. Next, she covers working with Cupboard, an open-source project dedicated to simplifying your SQLite interactions. To wrap up, she dives into working with Realm, an object database solution designed with mobile devices in mind. Throughout the course, Annyce discusses establishing relationships between database tables, creating and running queries, as well as performing data migrations.
- Overview of SQLite
- Defining a database table's schema
- Exploring SQLite create table syntax
- Executing create table statements
- Inserting data with a foreign key relation
- Inspecting the database using a terminal
- Updating and deleting records
- Working with Cupboard
- Working with Realm
Skill Level Intermediate
Android App Development: Unit Testingwith James P White2h 59m Intermediate
1. SQLite Basics
2. SQLite Beyond the Basics
3. Working with Cupboard
4. Realm Basics
5. Realm Beyond the Basics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.