‫Hello, my friends.
‫We are going to start with the Paging Library and Android Jetpack.
‫Why Page?
‫The Paging Library helps you load and display pages of data from a larger dataset from local storage
‫or over network.
‫This approach allows your app to use both network bandwidth and system resources more efficiently.
‫So what are the benefits of Beijing?
‫In memory caching for your page data.
‫This ensures that your app uses system resources efficiently while working with the page data built
‫in request deed application ensuring that your app uses network bandwidth and system resources efficiently.
‫Configurable or recycler view adapters that automatically request data as the user scrolls toward the
‫end of the loaded data.
‫Think about that.
‫You have a database with 1000 movies and the user want to display only like first 20 movies.
‫You are not going to make a request that gets all 1000 movies.
‫And in order to to download and display only the first 20 movies, you need to display and make connection
‫and make requests from the database according to only the requested, which is that many movies.
‫So we are going to use the Paging Library in order to fetch that.
‫I requested that request data as the user scroll towards the end of the loaded data.
‫So as that user needs, we are going to display that data.
‫This is the benefits of using the paging built in support for error handling, including refresh and
‫retry capabilities.
‫Don't worry, we are going to build a very big project that will use that MVP, that paging, and we
‫are going to introduce the Grandal and Hilde and other advanced topics.
‫The structure.
‫We have three, three parts the page, the list adaptor the page list and the data source.
‫These are for paging to library.
‫There is a big update that we are going to migrate towards, which is the Paging Library three.
‫So these would be like modified or updated with other naming, but the same concept that they is the
‫same target of using like data source, it becomes paging sources.
‫And the next slide we are going to see how we are going to migrate for the next generation of paging
‫three.
‫First of all, let us introduce that.
‫We have three structures that we are going add or three class that we are going to create the page list
‫adapter that replaces recycler view adapter class the page a list loading data automatically and data
‫source which is an interface for data providing.
‫So there is one note that we should mention that all our concentration would be on the data source.
‫And it's very, very important to understand that data source is divided into three.
‫Parts or three types.
‫This interface, the data source, we can make it page key data source passing the page number as a
‫query parameter in the request, which is the case that we are going to use and that the empty be the
‫movie database API key that we have used in the previous core, the previous projects, and we are going
‫to use the paging with that, the MDB API.
‫So we are going to display, for example, if the API contains only the first one or the first ten movies,
‫each page contain ten movies.
‫So we are going to work according to the pages and we have in the API like 50 pages.
‫So we are going to use that page key data source as a an instance of the data source goes the key here
‫and that equals depends on the page item key per a data source fetch the data using a key belonging
‫to item example fetch movie according to ID.
‫So if you are going to fetch the movies according to its ID, then you are going to use the item key
‫data source.
‫The positional data source, which is the third type of data source, which fetch items with arbitrary
‫position.
‫No.
‫As I told you, we are going to work with page key data source and because we are going to depend on
‫pages in order to display the data migrating from page two to page three.
‫There are a lot of outdated tutorials on the internet regarding the Paging Library, so we are like
‫that.
‫The first who are going to introduce the Paging Three, which is like migrating from paging to Beijing
‫City.
‫There are some differences that like the paid page list adapter will become page data adapter that that
‫data source will become paging source.
‫The live page list builder will be page or the page.
‫The list that config will be paging config.
‫And the data source, that factor would become the same.
‫Okay.
‫So this is about the paging library.
‫And next, we are going to build a real app that uses the paging.