The answer is quite simple, it takes less time to build the entire UI than we were used to. This is possible because we are dealing with less boilerplate code. There are no RecyclerView adapters involved, no Databinding, and even no XML files. Everything can only be done with Kotlin code. I think it’s every programmer’s dream to deal with code that is much simpler, cleaner, and easier to use and maintain. Besides that, who doesn’t want to save some valuable time? Pretty awesome, right?
When you want to delete a record from Cloud Firestore, you want to do it fast. So there are a few gestures that can help us achieve that. We can swipe, we can long-press on an item, or even use multiple item selections.
In this article, I will show you how can we delete a record, on a RecyclerView item left/right swipe.
I will use the latest technologies that are recommended by the Android team. I will use the MVVM Architecture Pattern with
ViewModel. For the asynchronous calls to Firestore, I will also use Kotlin Coroutines, for dependency…
In a regular SQL database, counting the number of records in a table is by far one of the simplest operations you can perform. Let’s assume we have a table called products, and to actually count the total number of records that exist within the table, the following simple SQL statement is required:
SELECT COUNT(*) FROM products;
On the other hand, when it comes to Firestore, the massively scalable NoSQL database from Google, you won’t find a built-in API that can help you count the total number of documents in a collection. So by default, you’ll have to download all…
When it comes to reading data from Cloud Firestore, there are two options available. The first one is to read the data using a persistent listener, meaning that we’ll always be in sync with the Firebase servers, or we can read the data only once. The first option is very helpful when we need to listen for changes in real-time. We can achieve this using Query’s addSnapshotListener() method. This method adds a listener for changes in the data at a collection in the database or a query. Each time the data changes, the listener will be invoked with an immutable…
That’s by far the most common and annoying error that you can get when you try to perform a Query against a Cloud Firestore database for reading data, or when you try to create/update/delete Firestore documents. So I’m trying to show you in this article, a few solutions that can help you get rid of this error.
First of all, let’s understand what this error actually represents. Generally, when we interact with Firebase products, and something goes wrong, a FirebaseException will be thrown. When it comes in particular to Cloud Firestore, when something fails, there is a specific exception that…
As a constant contributor in the Firebase community on Stackoverflow, I’ve seen so many questions regarding the way we can make Firebase products work together using technologies that are recommended by the Android team. Here are a few examples of the frequently asked questions I’ve seen so far:
This Extension composes and sends an email based on the content of a document that is written to a specified Cloud Firestore collection.
There a lot of cases in which we need to send information to our users via email. Fortunately, Firebase has created an Extension called Trigger Email, that can help us achieve exactly that. It’s really, really easy to install and use.
How does it work?
This extension will compose and send an email as soon as a new document is created into a selected collection in Firestore. You can call this collection “mail”, “mails” or “emails”, or whatever…
When I tested, I never got such an error. I'll take a look in the following days, and try to simulate the error. So if I succeed, I will update the repo as well.
Perhaps, a regular clean-up might be benefic. Yes, good point, it's super simpler in this case, to undo a delete operation. Just reverse the value of isDeleted property, and that's pretty much it.
When it comes to reading data from Firebase Realtime Database, there are two options available. The first one is to read the data using a persistent listener, meaning that we’ll always be in sync with the Firebase servers, or we can read the data only once. The first option is very helpful when we need to listen for changes in real-time. We can achieve this using Query’s addValueEventListener() method. This method adds a listener for changes in the data at a particular path in the database. Each time the data changes, the listener will be invoked with an immutable snapshot…
Google Developer Expert for Firebase. Speaker and Writer. Android Developer. Java Trainer.