Why do we need pagination?
Let's say we have an Android application that allows you to explore GitHub repositories by displaying a list of projects. It does that by querying the GitHub REpresentational State Transfer (REST) application programming interface (API) with Retrofit and obtaining a fixed number of repositories inside the app. While the REST API serves the application with detailed information for each repository, the app only uses and displays the title and description of the repository.
Note
Don't confuse the Repository classes in our project architecture that abstract data logic with the GitHub repositories that are displayed in our Repositories App.
Now, let's imagine that this application retrieves and displays 20 repository elements. Because of this, the user will be able to scroll the content until the 20th element, and therefore will be able to visualize no more than 20 elements.
But what if we wanted to allow the user to explore more repositories...