Logo

dev-resources.site

for different kinds of informations.

Kotlin Firestore example - CRUD Operations with RecyclerView | Android

Published at
4/4/2021
Categories
kotlin
firestore
recyclerview
android
Author
loizenai
Author
8 person written this
loizenai
open
Kotlin Firestore example - CRUD Operations with RecyclerView | Android

https://grokonez.com/android/kotlin-firestore-example-crud-operations-with-recyclerview-android

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:

cloud-firestore-crud-demo-show-notes

Firebase Console for Firestore will be like:

cloud-firestore-crud-demo-console-show-notes

2. Cloud Firestore

2.1 Add Firestore to Android App

cloud-firestore-console-add-project

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

kotlin-cloud-firestore-add-firebase-project

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

cloud-firestore-console-add-firebase-android-json

  • Add Service plugin for Gradle:

cloud-firestore-console-add-firebase-gradle

  • Open build.gradle (App-level), add dependency:
    
    dependencies {
    // ...
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.firebase:firebase-firestore:11.8.0'
    }

apply plugin: 'com.google.gms.google-services'

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

cloud-firestore-console-config-auth

More at: https://grokonez.com/android/kotlin-firestore-example-crud-operations-with-recyclerview-android

recyclerview Article's
25 articles in total
Favicon
How to Avoid Blinking in Android Recycler View
Favicon
Introducing RVTimeTracker - RecyclerView Time Tracker
Favicon
RecyclerView Last Item Extra Bottom Margin
Favicon
RecyclerView pagination scroll listener in Android
Favicon
Mostrando os Pokémon com Coil em Android
Favicon
How to create an Expandable Item in Android RecyclerView?
Favicon
Listener de clique no RecyclerView com Kotlin
Favicon
Cloud Firestore Android example – CRUD Operations with RecyclerView
Favicon
Kotlin Firestore example - CRUD Operations with RecyclerView | Android
Favicon
6 Things You Might Not Know About RecyclerView
Favicon
Implementing ListView inside RecyclerView and observing LiveData
Favicon
The Simplest Recycler EmptyView
Favicon
Learn to make list using RecyclerView
Favicon
ExpandableRecyclerView: Expandable Items With Room Database in Kotlin
Favicon
Generic RecyclerViewAdapter
Favicon
Android RecyclerView StickyHeader without external library
Favicon
Doing Android Long Lists Effectively
Favicon
Android RecyclerView single choice adapter
Favicon
Scrolling... Scrolling... RecyclerView for Android with Kotlin!
Favicon
Small RecyclerView XML feature
Favicon
How to use a RecyclerView to show images from storage
Favicon
RecyclerView - II, adding onClick to list items
Favicon
GKE: Ingress Controllers
Favicon
RecyclerView - I
Favicon
Merge Multiple adapters with MergeAdapter

Featured ones: