Data exchange between Android SQL-Lite and SQL Sever without using webserive

I want to create an Android application that receives data from a user offline and stores it in a local SQL-Lite database. Later, when the phone is online, the user can click the "sync" button, and then all the data stored in the local Sqlite database needs to be loaded into the database on the central server.

The question is, how can I implement this without using any web service? ITTIA DB SQL allows us to have replication between these two databases, but I'm looking for a built-in Sqllite or SQLserver function to implement something like replication, or even more, two way replication.



source to share

1 answer

put your local db behind the content provider and let the content provider handle offline and synchronized.

take a look at google started syncing their data , this is different from your scenario but gives you some ideas and best practices.

In your case, the content provider can replay transactions to the remote DB when a network connection becomes available, or it can store all transactions in another small sqlite db and just send that db "update" to your server. Make these changes to your server. Different approaches can be used at the back end depending on your database.



All Articles