发送的SQLite数据库到Web服务 [英] Sending SQLite db to web service

查看:289
本文介绍了发送的SQLite数据库到Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用填充它与众多的纬度和经度SQLite数据库。然后我需要将数据存储在外部的SQL Server数据库。我遇到的问题是,文件发送到Web服务。我找不到在类应该如何看待这需要在数据库文件,并将其存储在一个单独的SQL Server数据库的实例。这是连我应该快到我的问题的方式吗?

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?

推荐答案

一个更好的方法是发送实际的纬度/长数据通过Web服务数据库而不是将整个数据库文件本身。

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:


  • 这应该是简单得多实施

  • 您将不需要支持在服务器端的SQLite,只需在客户端

  • 数据建立将是立即可用于查询 - 而不需要从SQLite的数据库文件中提取可用于前

编辑:您上传多久和多少,完全取决于你。你可以把它的用户激活或某个时间间隔和批量上传的方式或单在-A-时的最新数据,直到你最新的。在这两种情况下,你将跟踪需要与时间戳被上传的数据。

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.

散货为转流一个简单的方法是拉,你需要从你的SQLite数据库保存,并把它变成一个JSON或XML对象,将PTED在服务器上为一个集合间$ P $的数据纬度/经度数据。这将使整个上传到一个单一的Web服务调用,而不是通过你的最新记载循环和调用Web服务的每个项目。

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.

这篇关于发送的SQLite数据库到Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆