Malik Awan
Malik Awan

Reputation: 1

Replicate Sqlite and sql server

my application needs to store data locally on sqlite DB and user can upload data on server once the internet connection is available. I assume I need to do some DB replication, how to accomplish that? Is there any android built in facility? Or I need to use some third party tool for that? I read many answers on this but I am still not clear about it, I will use KSOAP2 web service for communicating with server. Using KSOAP2 how can I Sync my sqlite data on SQL Server?

below are few links I read. https://stackoverflow.com/questions/18207021/opensource-replication-tool-for-sqlite Regarding sqlite replication Does SQLite support replication? Thanks in advance.

Upvotes: 0

Views: 1894

Answers (1)

AlexS
AlexS

Reputation: 5345

You shouldn't use dumps to copy the whole database back and forth. Android is running on mobile devices and datatransfer is likely to cost money or to be limited by speed or volumne or other means.

Therefore you should build your own webserver and upload/download only the changed entries. This means you will probably have to implement your own replication-logic, since I don't know any tools for that.

For example you can send a timestamp and the server replies with a set of changed data.

I'd recommend building a Restful-Webservice and using HttpUrlConnection to build POST, PUT, GET and DELETE requests.

GreenDao proposes a project for client/server-synchronization. But there is no estimation on when it will be available. If you do something yourself, you could try doing it as greendao-feature. A lot of people will thank you for that (myself included :D).

You can also have a look at symmetricDS, which should work on android.

Upvotes: 1

Related Questions