When attempting to build an efficient app, data efficient data loading strategy is the key to achieving overall efficiently. It makes no sense to download hundreds of data at a go as users rarely go through all that data. Not does such an action lead to slower app but also it wastes users bandwidth thus costing users money. Thus being able to implement pagination properly is key to an efficient app. It allows you to download data in chunks as the user scrolls. Thus we download only data that is needed.
SOURCE CODE REFERENCE :
In this lesson I teach you guys how to implement pagination in android with Firebase Realtime database as our data store. We use Load More pagination technique. We listen to recyclerview scroll events thus loading data if the user reaches the bottom of the recyclerview.
A progressbar is shown as we download data. If the user clicks a single item, we open the detail page or the detail activity.