Synchronize SQL Lite database on Android device and SQL Server database

We are trying to synchronize SQL Lite databases hosted on different Android devices and a SQL Server database hosted on a central server. We excluded the use of the web service due to the precondition of the client. Could there be another way?

PS: we are allowed to connect 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

+6
source share
3 answers

How would you connect them to the server "at the end of the day"? As a rule, what would you do in such a situation, a custom application is written on the device, which synchronized data whenever possible.

You can do this in various ways.

Firstly, you need to write a Service that sits and checks if it has the ability to connect to the web server (for example, you could just use the LAN connection and make a preference for the line that determined which server you wanted to synchronize with), and then sync this way.

This service can be controlled by Intent. You can also write a script that issued commands for adb that made the necessary transitions between the device (if it was connected via USB) in order to synchronize.

I would think that the best way to do this could be to โ€œsynchronizeโ€ the activity in your application. This action may have a button that, when pressed, initiates synchronization with a remote client via the Internet (what, as you said, do you have, but how are you going to connect to it?).

+1
source

Check out this implementation of the Microsoft Sync Framework Toolkit. I'm not sure he's ready yet.

+1
source

Although open web services should not be used, any HTTP interface / method can be opened / implemented on the server, which can be called to transfer data to the device. Maybe a dedicated web application should be written only to receive data from your devices and this application will take care of transferring the content to the sql server.

With another alternative [which connects the device] you need to transfer / export the device data as a file in some consistent format, which can then be used by the Windows service / form application.

+1
source

Source: https://habr.com/ru/post/908588/


All Articles