Data synchronization between sqlite and mysql android

I am currently working on an application in which I use the sqlite database when the device does not have an Internet connection and you use web services when the Internet is available.

I have to ask, what is the best method for synchronization?

  • Can I check the boxes and check for updates and then sync.
  • or any tool available that takes care of this.
  • or any other available method.
+4
source share
3 answers

You can do one thing:

When you make a web call, return one value to the "LastSyncedDate" field, save this date value in the Android application.

So, whenever you make a web call the next time, send that saved value to the web call.

Note: This answer is for checking the latest synchronization done in an Android application.

+2
source

I think I will make the boolean function same as: -

 public static boolean isNetworkAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = connectivityManager.getActiveNetworkInfo(); if (info == null) return false; return info.isConnected(); } 

& Check if the network is available: - Call the web services, otherwise call your SQLite database.

+2
source

SymmetricDS Pro is a tool designed to synchronize SQLite databases on Android.

SymmetricDS now has a web-compatible, fault-tolerant database synchronization software available on the Android mobile computer platform. The Android client follows all the same concepts and displays the same basic SymmetricDS functions on Android as the full-featured Java-based SymmetricDS client. The client is designed to link to the library to run in the process with an Android application that requires synchronization for its SQLite database.

Android App Sync

+1
source

All Articles