I'm currently developing a Field-Service application that stores data in the local sqlite database on an a开发者_C百科ndroid device. At some point, usually after completing the data collection rounds, the local sqlite db is to be synchronized to a remote sybase db on the server.
Any suggestions as to how this could be achieved or engineered as a solution? Or even better, are there alternatives to synchronizing data in such an application?
There are two general solutions that come to mind:
You could have the device send the data to your server in some sort of text format (json, xml, etc) and implement a web service that collects the data. However, both the device and web service will need to understand the protocol.
You could also have the device send the raw database file to a web service and have it open the database, read the file (via SQL) and copy out the necessary bits. However, this couples your device and server to the database schema, but might be less work to actually send the data.
Either way, you'll need some sort of web service to listen for the data that the device wants to send back. The only sticky part is which mechanism you choose.
精彩评论