Paging 3 & Jetpack Compose – Android Development | Part 4 – Remote Mediator – Offline Caching



Paging 3 & Jetpack Compose – Android Development | Part 4 – Remote Mediator – Offline Caching

Paging 3 & Jetpack Compose - Android Development | Part 4 - Remote Mediator - Offline Caching

🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
https://stevdza-san.com

🐱‍👤 Wanna become a member? Join!
https://www.youtube.com/channel/UCYLAirIEMMXtWOECuZAtjqQ/join

📸 Instagram
https://www.instagram.com/stevdza_san/

Other parts:
Part 1 – https://youtu.be/2Tj0LO5L2Dk
Part 2 – https://youtu.be/LoBCF-2TtKw
Part 3 – https://youtu.be/JfixpS_F35k
Part 5 – https://youtu.be/xIB4pRtNBjE
Part 6 – https://youtu.be/QhwVe3RBfqw

💻 Source code: https://github.com/stevdza-san/Paging3JetpackComposeDemo

ABOUT PAGING 3

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.

The Paging library includes the following features:

– In-memory caching for your paged data. This ensures that your app uses system resources efficiently while working with paged data.
– Built-in request deduplication, ensuring that your app uses network bandwidth and system resources efficiently.
– Configurable RecyclerView adapters that automatically request data as the user scrolls toward the end of the loaded data.
– First-class support for Kotlin coroutines and Flow, as well as LiveData and RxJava.
– Built-in support for error handling, including refresh and retry capabilities.

———–

ABOUT THE PROJECT

In this Tutorial Series I’m going to teach you everything you need to know about using a new Paging 3 library with Jetpack Compose in Android. We are going to build one simple app that will communicate with Unsplash API in order to display it’s images in our Android app. You will see how a pagination is being implemented.

You will learn how to paginate from both Network and a local Database. Instead of getting all data at once, we are going to fetch the data page by page. And not just that, you will also learn how to implement a Remote Mediator, a class that is the part of Paging 3 library which will allow us to automatically cache the data from the Network in our local ROOM database, so that we can access that same data even when our device is offline. Two different database tables will be included in this series, the first one will contain the actual data from Unsplash API, and the second table will be used to store Remote Keys. Remote Keys are basically an information which will allow our Remote Mediator to know which page to request next. That way, whenever we scroll and reach the bottom of the list in a Lazy Column, it will immediately know which page of data to request next from Unsplash API.

⌚Timestamps
0:00 – Introduction
1:46 – Implement Remote Mediator
16:50 – Create Repository
19:24 – Conclusion

Comments are closed.