In the situation of Database + Network, you mention at 26:34 very briefly that to keep our data fresh, just whoever starts observing the stream of data simply start a new fetch. I have a list of movies and people can like movies, so the likes counter grows. What's the best solution to keep that counter updated considering that I'm also using this pagination library?
I may be wrong but this library sounds non-trivial and sounds like it requires a real deep integration into the app which renders it super difficult in future to replace when the next shiny library is released. Tread with caution I guess... unless you're building an app which won't survive longer than a year.
It is non-trivial, but it is easy to replace. Lets say you're not using a viewmodel. So you have your app (recyclerview) and a datasource/dataprovider (whether local db or network). All you need is to create the LivePagedListBuilder, and a datasource class that adapts to your data provider(db/network). So you have two things in the middle. It's like a recycler view and an adapter to handle your list. Also, the problem isn't a new shiny thing. The problem is wanting to use every new shiny thing. If you have a solution that works the way you want it to, then no need to look at Paging library. My problem with the samples are, they are overly engineered. So it takes a while a strip out the important bits. But you learn some neat code along the way.
I thought the same. But then I decided to learn kotlin because all the codelabs regarding the new fresh libraries are written in kotlin only...so decided to learn kotlin. I must admit that it is a very good language when it comes to develop Android Apps. So I would recommend to learn it.
That is right. But it is very easy to learn Kotlin when you have Java background. And also give up Java is a very long story for every Android enterprise.
github.com/googlesamples/android-architecture-components/tree/master/PagingWithNetworkSample Probably you want this. and also you can see almost all Android architecture components example from here: github.com/googlesamples/android-architecture-components
For whoever is interested in this, now there is also an exercise on codelab. codelabs.developers.google.com/codelabs/android-paging/index.html?index=..%2F..index#0
@@rahulprasad2311 someone have multiple recyclerViews in an activity/fragment, all of them have horizontal orientation, but last one has vertical orientation, now I have to implement pagination on this recyclerview, so that we have to put all the recyclerviews in a nestedScrollView.
@@salmanhameed9495 Not the way to go, NestedScrollView will consume the vertical scroll and you'll end up with the vertical RecyclerView not recycling any view at all (horizontal RecyclerView will recycle actually). You have to check out Epoxy or another library to implements this sort of nested RecyclerView
@@salmanhameed9495 I've 2 RecyclerView contained in a NestedScrollView and using Paging Library with the last RecyclerView. However, the PageKeyedDataSource always calls loadAfter() method after I submit list to PagedListAdapter although I do not scroll the bottom RecyclerView. How can I resolve this bug?
Hi guys, I'm wondering how do you invalidate small set of the datasource? For example, in the video Yigit says that, in a Contact List Application, contact that start with H to O has changed. How do ask the datasource, whether its Positional, ItemKeyed, or Paged data sources to load only at certain position? Any help will be appreciated, thanks!
In my application, I am invalidating the source whenever a new item is added to the database. But the PagedList jumps to the top of the list whenever I do so. Can anybody help please...
I'm honestly done with listening to these people. When they finish hacking and rehacking, implementing one language, then another, one API, then another....when they all agree and can write a book on Android, I'll listen. Honestly I can't keep up with all the tricks, magic, DSL they invent.
Radu Savutiu me too. When they invent something, they are base on general case, even can suit 90% of use case, but unfortunately we developers are easily falling into the 10%. I am done with them too, I just want something simple and time saving, so I can focus on the business logic, testing, UI, performance, not a complex and bulky framework which I have to re-invest time on so-called “new” or “excited” things, so can be integrated into my own work which cost days...
You can create unmaintainable enterprise level apps using Java or whatever language. When you learning new stuff they always looks as a mess. Keep going.
Recycleview only creates viewholders that are on screen (well a bit more) but it still has the full list in cache. Here the list that list that recycleview stores in cache is smaller and not only the viewholder that are created.
exactly as Rok Retar said. RecyclerView still contains the whole chunk of the list. With this, I think, you are feeding the recyclerview the data that it needs to display. I think it is very useful when you are getting large data from the internet.
We got it. Another library.
It would be nice if we have something like NetworkBoundResource for BoundaryCallback. I mean a generic Java code sample. :)
Why they were using asyncTasks for everything (tutorials, samples, etc) and now I am seeing executors everywhere?
I agree
I only heard about executors from github samples, now I am using them also
AsyncTask class is deprecated
In the situation of Database + Network, you mention at 26:34 very briefly that to keep our data fresh, just whoever starts observing the stream of data simply start a new fetch. I have a list of movies and people can like movies, so the likes counter grows. What's the best solution to keep that counter updated considering that I'm also using this pagination library?
I'm asking myself the same thing, or what if some data at the backend has been deleted? I can't find anything online on this subject
I may be wrong but this library sounds non-trivial and sounds like it requires a real deep integration into the app which renders it super difficult in future to replace when the next shiny library is released. Tread with caution I guess... unless you're building an app which won't survive longer than a year.
It is non-trivial, but it is easy to replace. Lets say you're not using a viewmodel. So you have your app (recyclerview) and a datasource/dataprovider (whether local db or network). All you need is to create the LivePagedListBuilder, and a datasource class that adapts to your data provider(db/network). So you have two things in the middle. It's like a recycler view and an adapter to handle your list.
Also, the problem isn't a new shiny thing. The problem is wanting to use every new shiny thing. If you have a solution that works the way you want it to, then no need to look at Paging library.
My problem with the samples are, they are overly engineered. So it takes a while a strip out the important bits. But you learn some neat code along the way.
No java examples lead me to believe that google plans on letting java die out eventually.
Future is Kotlin :)
you can be sure xD
I thought the same. But then I decided to learn kotlin because all the codelabs regarding the new fresh libraries are written in kotlin only...so decided to learn kotlin. I must admit that it is a very good language when it comes to develop Android Apps. So I would recommend to learn it.
there's no doubt on that. It was obvious when they made kotlin official
That is right. But it is very easy to learn Kotlin when you have Java background. And also give up Java is a very long story for every Android enterprise.
Is this all even possible in Java to begin with?
Any github example would be great...
github.com/googlesamples/android-architecture-components/tree/master/PagingWithNetworkSample
Probably you want this. and also you can see almost all Android architecture components example from here:
github.com/googlesamples/android-architecture-components
github.com/googlesamples/android-architecture-components/tree/master/PagingWithNetworkSample
For whoever is interested in this, now there is also an exercise on codelab. codelabs.developers.google.com/codelabs/android-paging/index.html?index=..%2F..index#0
Thanks to Dev team.
Does it work with recycleview inside nestedscrollview ? If not then it end up with normal paging some where and new paging some where that look bad
why do someone need recyclerview inside nestedscrollview
@@rahulprasad2311 Why is irrelevant. Just answer the question.
@@rahulprasad2311 someone have multiple recyclerViews in an activity/fragment, all of them have horizontal orientation, but last one has vertical orientation, now I have to implement pagination on this recyclerview, so that we have to put all the recyclerviews in a nestedScrollView.
@@salmanhameed9495 Not the way to go, NestedScrollView will consume the vertical scroll and you'll end up with the vertical RecyclerView not recycling any view at all (horizontal RecyclerView will recycle actually). You have to check out Epoxy or another library to implements this sort of nested RecyclerView
@@salmanhameed9495 I've 2 RecyclerView contained in a NestedScrollView and using Paging Library with the last RecyclerView. However, the PageKeyedDataSource always calls loadAfter() method after I submit list to PagedListAdapter although I do not scroll the bottom RecyclerView. How can I resolve this bug?
Oooh 11:50 RxPagedListBuilder that is cool
If any one know how to do operations like remove/add in paged list and update recyclerview... reply
Hi guys, I'm wondering how do you invalidate small set of the datasource? For example, in the video Yigit says that, in a Contact List Application, contact that start with H to O has changed. How do ask the datasource, whether its Positional, ItemKeyed, or Paged data sources to load only at certain position? Any help will be appreciated, thanks!
It's call library, but I searched for Paging in Firebase Queries but unfortunately nothing :(
In my application, I am invalidating the source whenever a new item is added to the database. But the PagedList jumps to the top of the list whenever I do so. Can anybody help please...
Someone have an example that shows placeholders?
I'm so sad there is no java example for beginners :(
I'm honestly done with listening to these people. When they finish hacking and rehacking, implementing one language, then another, one API, then another....when they all agree and can write a book on Android, I'll listen. Honestly I can't keep up with all the tricks, magic, DSL they invent.
man its dose not matter if you listen or not, you need them they don't need u
Radu Savutiu me too. When they invent something, they are base on general case, even can suit 90% of use case, but unfortunately we developers are easily falling into the 10%. I am done with them too, I just want something simple and time saving, so I can focus on the business logic, testing, UI, performance, not a complex and bulky framework which I have to re-invest time on so-called “new” or “excited” things, so can be integrated into my own work which cost days...
once you learn Kotlin, you will regret saying that, trust me
You can create unmaintainable enterprise level apps using Java or whatever language. When you learning new stuff they always looks as a mess. Keep going.
@@FabienHerman Say what? !!!
Important and great talk :) !
I'd rather make custom pagination whenever user scrolls to bottom.
Why not java example?
good question TBH. i myself havent found any reason to migrate to kotlin
Koltin is the future.
Cody Liu
You are wrong.
Koltin is the present.
31:37 blog post url: goo.gl/rBQFvS
Isn't recyclerview supposed to cache and only load what is visible anyway, so what's the point of this.
Recycleview only creates viewholders that are on screen (well a bit more) but it still has the full list in cache. Here the list that list that recycleview stores in cache is smaller and not only the viewholder that are created.
exactly as Rok Retar said. RecyclerView still contains the whole chunk of the list. With this, I think, you are feeding the recyclerview the data that it needs to display. I think it is very useful when you are getting large data from the internet.
Can I download the PPT or keynote file?
To anyone planning to use this Library DON'T. Its absolute TRASH!. You cant even remove items from the list.
@manideep lanka i feel your pain
@@DannTeBg What do you mean by "you cant even remove items from the list"?
please follow up on "You cant even remove items from the lists". Why?
I can barely understand this guy. So he must be smart!
You don't need to understand.most important is that Google shows how diverse their engineers are
Why its so complicated?
Any java example ?
Thank you google, very cool 👍
That thick turky accent =))
putin carving turkey for dinner.
horrible , ios win simple is better
Google software is always terrible over engineered. Thats the typical result when you hire only the smartest people on the market