How to implement pagination in Kotlin

  Рет қаралды 15,296

Android Geek

Android Geek

Жыл бұрын

With the paging library, you can load and display small chunks of data at a time. Loading partial data on demand reduces the usage of network bandwidth and system resources.
In this video, we will work on a previous project that we had in the Hilt series, and we will add pagination to this project
How to use Hilt with Retrofit :
• #3 How to use Hilt wit...
💾 Github Source :
github.com/ezatpanah/Paging-Y...
🗒️ Medium's Article :
androidgeek.co/how-to-impleme...
✨ Join Medium to read thousands of valuable stories ✨
/ membership
If you're looking to enhance your Android skills or have any questions about the field, feel free to reach out to me on MentorCruise. I'm here to support your growth and learning! Let's connect and learn together! 📚💡
mentorcruise.com/mentor/reyha...

Пікірлер: 50
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
What is the next topic you would like to be taught? 🙂
@efendi3213
@efendi3213 Жыл бұрын
Hi. I'm a new subscriber and I'm very interested in this project for me to learn. Can you add bottom navigation? Thank you in advance.
@satyamlal5755
@satyamlal5755 Жыл бұрын
Can you please do any android project using Jetpack Compose which uses Firebase, API calls, animation etc.
@ilyas1569
@ilyas1569 11 ай бұрын
What about using RemoteMediator for Paging, getting datas from network or room db. It would be nice tutorial :)
@stupidfilip23
@stupidfilip23 4 ай бұрын
Hi, Can you explain Launch modes to us?
@ilyas1569
@ilyas1569 11 ай бұрын
Nice tutorial video, thanks 😊
@AndroidGeekCo
@AndroidGeekCo 11 ай бұрын
Thanks 😊🙏
@fingurepay3316
@fingurepay3316 Жыл бұрын
This video is very helpful for me thanks for this 🙂
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Glad it was helpful! 😊
@ind-exe
@ind-exe 4 ай бұрын
thank you very much you have helped me a lot and I have learned a lot from this video
@AndroidGeekCo
@AndroidGeekCo 4 ай бұрын
Glad to hear that!
@emadkeyvani1660
@emadkeyvani1660 Жыл бұрын
Again good subject 👍
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Thanks Emad 😊
@hossamqandel5303
@hossamqandel5303 Жыл бұрын
Thank u so much for this very important topic covering ♥️♥️♥️ I hope if could make a nested recycler view in best practic tutorial with movie api
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Glad you like it 😊 , two next videos will be about Nested RecyclerView ✨
@hossamqandel5303
@hossamqandel5303 Жыл бұрын
@@AndroidGeekCo ♥️
@lambuitung6754
@lambuitung6754 Жыл бұрын
Thank you so much for these tutorial like this ^^ . Hopefully you can make a complete app like netflix clone ... using topic you has been made like hilt, mvvm pattern, coroutine, retrofit etc. :D
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
you're very welcome 😊 yes sure, thanks for your suggestion ✨🙏🏻😊
@lambuitung6754
@lambuitung6754 Жыл бұрын
@@AndroidGeekCo im very glad to hear that. 🎉 and i think this type of tutorial will get more view :D
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Yes, totally right, btw i forgot to mention, most of the toturial in the channel ysed mvvm pattern... Just i didnt mention 😁 even last video... Data binding, used mvvm pattern... But sure, I will recored another series just for MVVM 😊
@eidergiraldo7269
@eidergiraldo7269 Жыл бұрын
very nice videos
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Thanks for your feedback😊
@antarezaghifary9670
@antarezaghifary9670 Жыл бұрын
Hallo sir, i have problem when data successfull load in recyclerview btn retry stay visible. how gone btn retry sir?
@user-ry4de9vo5x
@user-ry4de9vo5x 6 ай бұрын
if data is not paged then how can we page the data inside of code, there has a lots of api like dummy json has product that are not paged so in code how can i page the data?
@codetheandroid
@codetheandroid Жыл бұрын
Bro if we set holder .is recylable to false then our recycler view will not serve the purpose and if i uncomment it recycler view doesn't behaving good. The item i see at the top ...i also see the same at in between the list and also some items which present in upper side also present at the end of the list .
@sahibaliyev2445
@sahibaliyev2445 Жыл бұрын
Hi Reyhaneh, thank you for great tutorial. I want to give you idea for the next video... What about add movies trailer in detail fragment, cause themoviedb has API but i cant realise it, because there is no any url, only reference to youtube.
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Hi, thanks for your feedback 😊🙏Good idea 👍👍😊 let me check the api and then i will record a video about that 😊✨
@sahibaliyev2445
@sahibaliyev2445 Жыл бұрын
@@AndroidGeekCo Thank you teacher.
@vishalbhimani6339
@vishalbhimani6339 5 ай бұрын
@AndroidGeekGo I can not resolve my pagination issue .. can you please help me to resolve
@hassanammer7854
@hassanammer7854 Жыл бұрын
hello, I want to make a search functionality. should I use two classes as pagination sources?
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
You need to define a data class to represent the search results, and then create function that performs the search operation and returns a SearchResult object. Then, you need to calculate the necessary values for pagination. This includes the total number of pages and the starting index for the current page. You can do this by dividing the total count by the page size and taking the ceiling value for the total number of pages. Then you can slice the list of items based on the starting index and page size to get the items for the current page. Finally , Return the paginated results along with the total count. You can wrap the paginated items and the total count in a new SearchResult object. This is just an idea of the logic that i think shoud work... You can test it in the code 😊
@nourmorgan6751
@nourmorgan6751 Жыл бұрын
Do i have to make a paging source for every endpoint in my retrofit Interface ?
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
it depend on API that you used , most of the APIs supports pagination but there is some Api that does not support it
@dansb8432
@dansb8432 Жыл бұрын
new sub here
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Welcome to the channel 😊
@dansb8432
@dansb8432 Жыл бұрын
Just as contribution: If your API reach the end of records (that means, return null or empty), the app will perform infinite calls to API. To avoid this behavior, you need to check in every API call if there are records inside the list. Example: if(!data.TxTransactions.isNullOrEmpty()) {
@estefania7975
@estefania7975 Жыл бұрын
Hello there, thank you very much for this tutorial. I´m changing my project to support pagination, but I´m having a problem. I´m using data binding instead of view binding, since I changed my Adapter from ListAdapter to PagingDataAdapter one of my BindingAdapters stopped working (the one I use to load items in my recycler view), since it used the method submitlist (that received a list of items) but know I can only use submitdata (that receives an item). What can I do here? Thank you again
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Hi Estefanie , very welcome 😊 , it was in my schedule to create a tutorial for using Data-binding and also paging in Data-binding soon 😊, so I created a repo for you , you can check the code here : github.com/ezatpanah/DataBinding-Paging-KZfaq ,I will try to upload these videos in the next week 🤞🏻 , I hope this Repo would be helpful for you , if there is any question please don't hesitate and ask😊
@estefania7975
@estefania7975 Жыл бұрын
@@AndroidGeekCo that´s so very nice of you! I greatly appreciate this! I will check the code and will be looking forward to your new video. Have a nice weekend 🥰
@najmulhakansari3352
@najmulhakansari3352 Жыл бұрын
make video on recyclerview with click listener inside fragment and pass the onclick item data to another fragment
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
we have it in the channel: kzfaq.info/get/bejne/iqlzjcVoyqu9e4k.html&t in this video I used two fragments, and pass Id of the movie into another fragment , please check this vide 😊
@hieuahoang7556
@hieuahoang7556 Жыл бұрын
Can you make more videos? thanhks
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
yes, of course , I will try to make more videos in the future 😊✨
@Tuannguyen-bn6sp
@Tuannguyen-bn6sp Жыл бұрын
everything is perfect but i got duplicated item when i adapter.refresh() :(((
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
it is hard to say why you got duplicate data , I should see the code, please check again your code with the repo on GitHub
@onmoveonmove226
@onmoveonmove226 Жыл бұрын
We want check Internet connection using kotlin
@AndroidGeekCo
@AndroidGeekCo Жыл бұрын
Hi , kzfaq.info/get/bejne/p51djKyB09Kyj6s.html in this video we check internet connection with livedata 😊
@Tellthetaless
@Tellthetaless Жыл бұрын
17:24
@Tellthetaless
@Tellthetaless Жыл бұрын
13:01
@Tellthetaless
@Tellthetaless Жыл бұрын
14:14
How to use Nested RecyclerView in Kotlin ( Part 1 )
32:48
Android Geek
Рет қаралды 6 М.
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 35 МЛН
КАРМАНЧИК 2 СЕЗОН 7 СЕРИЯ ФИНАЛ
21:37
Inter Production
Рет қаралды 466 М.
CECS 453 Lab Assignment #5 video redo
2:27
Brandon Cazares
Рет қаралды 6
GOOGLE MAPS CLUSTER
2:34
burak selcuk
Рет қаралды 100
95% Don't Understand THIS About Coroutines (Main-Safety)
9:38
Philipp Lackner
Рет қаралды 25 М.
How to use DataStore Preferences  in Kotlin
24:34
Android Geek
Рет қаралды 9 М.
JavaScript CONSTRUCTORS in 5 minutes! 🛠
5:32
Bro Code
Рет қаралды 22 М.
Lab1 _tiepdvph30311_MD19305-AND102
1:39
trich
Рет қаралды 5
Paging with Paging 3
11:07
Android Developers
Рет қаралды 55 М.