mercredi 13 janvier 2016

How to make synchronization with webservice

I'm struggling with this issue for almost 2 days.

I need to make a synchronization of a Android App with a Webservice as follows:

The user press the sync button -> 3 refrotit calls are made (One for user Settings, another for Contacts and another for Address) -> The Settings, Contacts and Address are save into the SQLite Database -> A message box appears with a success message and a OK button -> When pressed, the OK button, star a new Activity

I already know how to make almos everything, the retrofit call, the insert on the Sqlite Database, create the message box, the only thing that I don't know how to do, is check when the Sqlite operation is finished (because there are many Contacts and it takes a few seconds to save them into the database), so I can call the message box, and if I should use retrofit asynchronous calls or synchronous, like One after another inside a AsyncTask?

Aucun commentaire:

Enregistrer un commentaire