Pagination in android recyclerview using retrofit
Pagination with Recyclerview allows the user to see the latest content page by page. As we load the next ‘page’ by the time users scroll to the bottom, more content is loaded and available. When to use Pagination? I’m sure you have a pretty good idea by now on when to use it. If you have a ton of content that takes too long to load. This can be either from a local database or an API call. Then it makes sense to use Pagination. If you’re pulling from a database, request data in batches (say 20 per request). The same also holds true for an API call. Now, do with an explanation. Let’s get started on the coding part of the pagination with the recyclerview in android . 1. Setup dependency for the pagination with recyclerview Add recyclerview, retrofit, and glide dependencies into the app build.gradle file. implementation 'com.android.support:recyclerview-v7:27.1.1' implementation 'com.android.support:cardview-v7:27.1.1' implementation 'com.squareup.retrofit2:retrofi...