Hi to all Android heroes out there, I have been facing this interesting 
problem which I am trying to explain here

I have a simple requirement of showing a large amount of data in recycler 
view in a grid view which I am achieving using the Paging library provided 
by Android Jetpack.
I am using *Single Source Of Truth *pattern in which data fetched from the 
server is stored in Room DB first and then the database is observed for any 
changes.
The data I am fetching is sorted. It starts with A then B and so on as I 
scroll down

Now the requirement is there is a scroller besides the recycler view which 
contains all the alphabet listed down in vertical fashion giving the user 
the functionality
to jump to any alphabet directly instead of scrolling down to reach it.
The total rows of data starting from A to Z are around 100,000.
Now suppose the user is scrolling in normal fashion and is on the data 
starting with A letter, suddenly he taps on P alphabet from the scroller 
then the app
should show the data starting with P and then it should resume it's the 
behavior of scrolling i.e if user scrolls up then he should see data 
starting from O and
if he scrolls down then he should start seeing data with Q and so on.

The next requirement is since I am using local DB via Room then I should 
update data only when it gets updated saving the hits to the server.
What should be the ideal way to sync data with server considering the fact 
that minimum hits go to the server and we do not have old data in local DB
How can I achieve above-mentioned functionalities in an optimized way

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/78a042e6-f884-424b-aeda-b1538c382b66%40googlegroups.com.

Reply via email to