Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Synchronization between SQL Lite database on an android device and SQL Server Database

We are trying to synchronize between SQL Lite databases hosted on different Android devices, and SQL server database hosted on a central server. We eliminated the use of a Webservice because of a client precondition. Could there be another way?

PS: We are allowed to hook the devices at the end of the day to a server that can host a windows service application or a windows forms application for the synchronization process.

Thanks

like image 547
Hassan Mokdad Avatar asked Feb 16 '12 06:02

Hassan Mokdad


3 Answers

How would you hook them to a server "at the end of the day?" Typically what you would do in this sort of situation is write a custom app on the device that synced the data whenever it was possible.

You could do this in a variety of ways.

The first is to write a Service that sits and checks to see if it has the ability to connect with a web server (for example, you could simply use the LAN connection and make a preference have a string which determined what server you wanted to sync to), and then do the sync that way.

This service could be controlled by an Intent. You could also write a script which issued commands to adb which did the necessary transitions back and forth between the device (if it were hooked up via USB) to do the sync.

I would think that the best way to go about this might be to create a "sync" Activity in your app. This activity could have a button that when pressed initiated the sync with the remote client via internet (which you said you had, but how are you going to hook up to it?).

like image 86
Kristopher Micinski Avatar answered Oct 22 '22 16:10

Kristopher Micinski


Check this implementation of Microsoft Sync Framework Toolkit. I'm not sure if it is ready yet.

like image 45
Ahmad Y. Saleh Avatar answered Oct 22 '22 16:10

Ahmad Y. Saleh


Though exposed web services are not supposed to be used, but can some HTTP interface/method be opened/implemented up on server that can be called for device to pass the data.May be a dedicate web app be written only to get the data from your devices and that app will take care of passing the content to sql server.

With the other alternative [that is hooking the device], you need to transfer/export the device data as file in some agreed format which can then be consumed by the windows service/form application.

like image 21
user1050134 Avatar answered Oct 22 '22 16:10

user1050134