android – What better way to work offline and synchronize data with server?

Question:

I'm working on a project where it will be necessary for users to register offline and then submit their registrations to the server as soon as the internet connection is available.

My problem is to know:

  • What is the best way to work offline? Preferably native Android.
  • When 2 users on different devices make a modification to one person's information, how will I update it on the server?

Answer:

The best way to keep information offline on Android is really SQLite .

But for the server-side update, I believe the best procedure is to mark the update with a version code and timestamp.

Thus, before sending the information to the server, you can check the configuration version and which of the concurrent versions is the most current.

You can also create a data " merge " rule on the server. Giving overlay preference to the most recent data.

Another practice that can be very good is to show the user that there is a data conflict and ask him which version to keep. One app that uses this method is Gameloft's "My Bad Favorite" (or "Minion Rush").

Scroll to Top