Data Persistence With Room

Learn how to persist data in your Android app using the Room SQLite wrapper from Google, and how to test your database using Espresso. By Lance Gleason.

4.2 (20) · 2 Reviews

Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Where To Go From Here?

You can download the final project using the link at the top or bottom of this tutorial.

There’s a lot more to learn and do with Room!

  • Migrations for making changes to an existing data store.
  • Indexes to make your queries faster.
  • Type Converters to make it easier to map database types to your own custom types.

Stay tuned for future Room tutorials where these will be covered. :]

If you’re just getting started with data persistence on Android and want some more background, you can check out our Saving Data on Android video course, which covers SharedPreferences, saving to files, SQLite and migrations, and also persisting using Room along with other Android Architecture Components such as ViewModel and LiveData.

As a challenge, you can also try to:

  • Add the ability to delete a list category.
  • Create a onClick event in each category that allows you to edit the category and save it to your database.

Feel free to share your feedback, findings or ask any questions in the comments below or in the forums. I hope you enjoyed this tutorial on data persistence with Room!

Puppy