which is better using FirestorePagingAdapter or manually paginate
As Frank van Puffelen explained in this post:
The
FirestorePagingAdapter
in the FirebaseUI library is designed to get data, not to listen for realtime updates.
And Doug Stevenson in this post:
Unfortunately, you can't have both realtime updates and paging at the same time.
So if you want to FirestorePagingAdapter
or the Paging Library
, it means you'll loose the realtime feature.
So which one is better using
FirestorePagingAdapter
or paginate
If you need to implement paging for your items and have in the same time the realtime feature, then please see my answer from this post and instead of using a get()
call, you need to use addSnapshotListener()
as explained in the official documentation regarding listening to multiple documents in a collection.
FireStorePagingAdapter not receiving realtime updates
What you're seeing is the expected behavior.
The FirestorePagingAdapter
in the FirebaseUI library is designed to get data, not to listen for realtime updates.
How to add 2 different queries inside an FirestoreRecyclerAdapter?
There is nothing built-in to combine two queries in a FirestoreRecyclerAdapter
.
The best I can think of is creating a List
/array of the combined results in your app code and then using an array adapter. It's not ideal, since you won't be using FirebaseUI.
Alternatively, have a look at FirebaseUIs FirestorePagingAdapter
, which combines multiples pages of (non-realtime) DocumentSnapshots
in a single recycler view.
Related Topics
How to Stack Firebase Cloud Messaging Notifications When the Application Is Not Running
Get Font Scaling Factor to Calculate the Fontsize
How to Perform Minification and Obfuscation with the Jack Compiler
Activity.Finish() Called But Activity Stays Loaded in Memory
Using Collate in Android Sqlite - Locales Is Ignored in Like Statement
What Are Best Practices for Using Aes Encryption in Android
How to Secure My App Against Piracy
Using a Broadcast Intent/Broadcast Receiver to Send Messages from a Service to an Activity
Create a Custom View by Inflating a Layout
How to Change The Navigationview's Item Text Size
Phonegap & Android - How to Use The New Select List Style
How to Get Screen Display Metrics in Application Class
How to Install Android Studio on Ubuntu
Not Enough Space to Show Ad (Admob)
Get Android .Apk File Versionname or Versioncode Without Installing APK