同步SQLite数据库到App Engine数据存储? [英] Sync SQLite Database to App Engine Datastore?

查看:170
本文介绍了同步SQLite数据库到App Engine数据存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android应用商店在离线模式过程中的SQLite数据库中的数据。当在线我希望应用程序同步(在两个方向),在云服务器(应用程序引擎)数据存储(数据库)。我该如何实现这个功能,这样我就可以显示在手机拍摄的在Web应用程序中的数据。也请建议如果有任何简单的替代方式。

The android app stores the data in SQLite database during the offline mode. When online I want the app to sync (in both direction) with the datastore(database) in cloud server (App Engine). How do I implement this functionality, so that I can show the data captured on phone on a web application. Also please suggest any simple alternative way if any..

推荐答案

我只写我的数据作为一个String(使用我可以重建我的数据格式),它传递给AE,解析和存储/显示它

I just write out my data as a String (using a format I can reconstruct my data with), pass that to AE, parse it and store/display it.

您可以使用JSON了。

You could use json too.

或尝试的http://mylifewithandroid.blogspot.jp/2010/10/client-server-communication-with-json.html

有关同步部分我使用时间戳。如果时间戳的结果不记录在服务器上,我记录下来。我送录制的邮票到客户端,从商店中删除。当然,服务器也可以发回新的结果,如果用户的记录是从一个不同的客户端更新。

for the sync part I use a timestamp. If the timestamped result isn't recorded on the server, I record it. I send back the recorded stamps to the client and delete them from the store. Of course the server can also send back new results if a user's records were updated from a different client.

这篇关于同步SQLite数据库到App Engine数据存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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