This course is available as part of the Professional subscription. To learn more click here

Cloud Firestore on Android - Getting Started

Dec 14 2021 · Video Course (40 mins) · Intermediate

In this Firebase course on Android, learn what Cloud Firestore is and how it can be used to provide a NoSQL cloud-hosted Database for your app. Learn how to read and write data to Firestore from an Android application, listen to display changes in Firestore data in realtime, and use Firebase security rules to secure your Firestore data. Also, write some complex Firestore queries to sort and filter through displayed data.


  • Kotlin 1.5, Android 12, Android Studio 4.2

Cloud Firestore

Learn about what a NoSQL database is and how Cloud Firestore is structured with Documents and Collections.


Set Up Firebase

2:34 Free

Set up Firebase using your Google account and configure it to work with the sample project.


After setting up the sample project to work with Firebase, we’ll discuss how the sample project works and how it will be communicating with Cloud Firestore.


Now that we’ve seen the app running, let’s take a look inside and see what’s under the hood.


Building a Digital Bookshelf App

Learn how to add a list of books to Cloud Firestore from within our Bookshelf app. We’ll add a list of random book data from within Bookshelf and check that the data has been added to Cloud Firestore.


To be able to display the data being read from Cloud Firestore, first there needs to be a RecyclerView that will display it, in this episode learn how to implement Firestore EventListener into a Recycler Adapter to facilitate this listening for any RecyclerView.


Now that we have an adapter that’s hooked up to an Event Listener, it’s time to handle those changes as they happen.


Now that we have an adapter that’s hooked up to a Changes Listener, it’s time to handle those changes as they happen.


In this episode, learn how to apply filters and sorting constraints on the list of books being displayed. Filter by author and category, sort by either year published, book rating or just alphabetically.


When in debug mode, Cloud Firestore will by default allow any access to the database for up to 30 days. These rules are way too permissive for a real-world production app, in this episode we’ll set up stricter rules to match a real scenario for data access.


Who is this for?

This course is for experienced Android developers who are interested in exploring the Firebase method of storing data on the cloud in a NoSQL database using Cloud Firestore. Familiarity with MVVM, using a ViewModel, RecyclerViews and their adapters is required as they are used to layout the foundation for the tasks that you’ll implement in the sample project.

Covered concepts

  • Documents
  • Collections
  • References
  • Reading data
  • Document Snapshots
  • Writing data
  • Data persistence
  • Offline access support
  • Sorting/Filtering queries
  • Composite Indexes
  • Listening to updates in realtime
  • Firestore EventListener
  • Firebase Security Rules