1

I am trying to correctly implement the MVVM pattern in my application.

What I want to do is a regular synchronization of a local database on the device with a remote database.

The tools to achieve this would be the following:

  • Use PeriodicWorkRequest for a periodic sync every X time
  • Use RequestFuture from Volley to get the remote data.

I have no experience using the MVVM pattern and even though I have read various tutorials I cannot assemble my code.

What I want to achieve is something exactly similar to what is explained in this repository: But in that code Retrofit is used, and I mostly get lost in the service part and how to launch / embed / bind Volley's answer in an MVVM pattern.

I have searched for tutorials on the subject and have not found any. I have a lot of code written, but I can't get it to work. As I mentioned before, I don't know exactly how to link the elements in the correct way and that is my main question: how to integrate Volley into the MVVM pattern to periodically synchronize my remote database with my local database?

A. Cedano
  • 557
  • 7
  • 39

0 Answers0