简体   繁体   中英

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

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

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.

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?).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM