DEV Community


Kotlin Firestore example - CRUD Operations with RecyclerView | Android

Software Engineer - Founder at
・3 min read

Kotlin Firestore example - CRUD Operations with RecyclerView | Android

Cloud Firestore helps us store data in the cloud. It supports offline mode so our app will work fine (write, read, listen to, and query data) whether device has internet connection or not, it automatically fetches changes from our database to Firebase Server. We can structure data in our ways to improve querying and fetching capabilities. This tutorial show you an Android app that can do Firestore CRUD Operations with RecyclerView.

Related Post: Kotlin Firestore example – CRUD Operations with FirebaseUI FirestoreRecyclerAdapter | Android

I. Technologies

  • Android Studio 3
  • Kotlin 1.2.0
  • Firebase Firestore 11.8.0

    II. Overview

    1. Goal

    We will build an Android App that supports showing, inserting, editing, deleting Notes from/to Cloud Firestore Database with RecyclerView:


Firebase Console for Firestore will be like:


2. Cloud Firestore

2.1 Add Firestore to Android App


  • When your app is created on Firebase Console, you will need to register Android Project. Now fill project package name to register your app:


  • Download google-service.json config file and follow instructions:


  • Add Service plugin for Gradle:


  • Open build.gradle (App-level), add dependency:
    dependencies {
    // ...
    implementation ''
    implementation ''

apply plugin: ''

  • We also need Authentication to work with Firestore. To simplify this example without Authentication steps, we will allow anyone be able to read or write to the database:


More at:

Discussion (1)

thanhlm profile image
Thanh Minh

Great post @loizenai

Do you use any tool to work with Firestore? I found is really helpful for the case