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

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.

Version

  • 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.

1

Set Up Firebase

2:34 Free

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

2

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.

3

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

4

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.

5

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.

6

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

7

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

8

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.

9

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.

10

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

Contributors

Comments