The data is collected from NewsApi.org
Hello there!
So I was struggling with this android pagination stuffs for quite some time now. You see, most of the tutorials are either really old(you don't want to see them), some only show you the paging library with networking support only, some only show database support, some don't show a loader at the ena of recyclerView and so on.Finally, last night I was able to code a sample pagination app successfully with networking, database support, a little loader at the bottom and an extra row at top(you know, for displaying stories/my day/ whatever you call it). So finally after understanding all these things properly, I wish to keep all of it in this project. I hope you'll like it.
We'll be using android paging library 2.1.2 as it is production ready. Though the paging library 3.0 alpha is released, it's still in alpha. So it might not be a good idea to use it in production. Hence the version 2.1.2.
Please go through the followings:
5. Connect Database with RecyclerView
6. Use BoundaryCallBack to Trigger Network Call
11. Factory Pattern For Online and Offline Support
If you have any questions, feel free to ask me and I'll try my utmost to answer you.
Thank you for reading.
- https://www.raywenderlich.com/6948-paging-library-for-android-with-kotlin-creating-infinite-lists
- https://blog.mindorks.com/implementing-paging-library-in-android
- https://proandroiddev.com/8-steps-to-implement-paging-library-in-android-d02500f7fffe
- https://medium.com/@sharmadhiraj.np/android-paging-library-step-by-step-implementation-guide-75417753d9b9