Sending SQLite db to web service

android, networking, sql-server, sqlite, web-services

Solution

A better approach would be to send the actual lat/long data to db via a web service rather than sending the entire db file itself.

Doing it in this way would accomplish several things:

- It should be much simpler to implement

- You would not need to support SQLite on the server side, just the client

- The data "set up" would be immediately available for querying - rather than needing to be extracted from the SQLite db file before it can be used

EDIT: How frequently and how much you upload is entirely up to you. You can make it user-activated or on some time interval and upload the latest data in bulk fashion or one-at-a-time until you're up to date. In either case you would track which data needs to be uploaded with a timestamp.

One simple method for transfering "in bulk" would be to pull the data that you need to save from you SQLite db and put it into a JSON or XML object which would be interpreted on the server as a collection of lat/long data. This would put the whole upload into a single web service call rather than having to loop through your "newest" records and calling a web service for each item.

Problem

I have an android app which populates a SQLite database with numerous latitudes and longitudes. I then need that data to be stored in an external SQL Server db. The problem I'm having is sending that file to a web service. I cannot find any examples on how the class should look that takes in the db file and stores it in a separate SQL Server db. Is this even the way I should be approaching my problem?

Original source