• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

95
Views
How to sync local database with remote server using Android Paging Library?

DataSource takes all data from local database (Room). BoundaryCallback loads new data from server only when reachs end. But what to do with items stored in room if they already changed/deleted from remote server? App will display it as they are still in our local database.

I read this article Paging Library: Database + Network but I'm not sure if this is only best solution.

Maybe I should create custom DataSource and DataSourceFactory which will get page from local database and async load the same page from remote server. Then remove local page from database and insert this new page. But it sounds even worse than in that article.

Is there a correct way to sync local database with remote database?

3 months ago ·

Santiago Trujillo

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.