Vahid Ghadiri
Vahid Ghadiri

Reputation: 4076

Exchanging data between Android SQL-Lite and SQL Sever without using webserive

I want to create an Android app that gets data from user in offline mode and stores them on a local SQL-Lite database. Later when the phone is in Online mode, the user can click a "sync" button and then all data stored on the local Sqlite database should be uploaded to a database on central server.

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

thanks

Upvotes: 3

Views: 173

Answers (1)

ashoke
ashoke

Reputation: 6461

put your local db behind a content provider, and let the content provider handle the offline and sync.

take a look at Google iosched how they keep their data in sync, this is different from your scenario, but gives you some ideas and best practices.

In your case, the content provider can replay the transactions for remote DB when network connection becomes available, or may be save all the transactions in another small sqlite db, and just send that "update" db to your server. On your server, apply those changes. Depending on your back end DB, different approaches can be used.

Upvotes: 2

Related Questions