android 将在线数据库数据与本地sqlite数据库同步
尽管我知道有很多关于 sqlite 的问题和文档,但我在任何地方都找不到关于这个特定问题的信息,如果这是重复的,我很抱歉。
无论如何,我正在开发一个应用程序,它通过 php 脚本让用户登录并在我的网站上的 mysql 数据库上执行操作。但是,为了让用户不必等待他们按下的每个按钮/每个活动启动的网络响应,我在应用程序上附加了一个 sqlite 数据库,该数据库在使用应用程序时存储实时信息(它使用 GPS 跟踪)所以这些数据和其他东西一样被存储)。
我想我的问题是,我应该在本地存储多少内容以便稍后上传?在最初登录用户并上传/同步用户配置文件中的数据 onPause() 或其他内容并利用生命周期后,我是否应该尝试在本地执行所有操作?或者我应该做相反的事情并尝试在线完成所有事情并完全摆脱本地 sqlite 数据库?
只是想知道是否有人经历过这种情况以及他们得出了什么结论。
感谢您抽出时间,
Infinitifizz
I couldn't really find information on this particular problem anywhere even though I know there is a lot of questions and documentation on sqlite so sorry if this is a duplicate.
Anyways, I'm developing an app which logs a user in and performs actions on a mysql database on my website via php scripts. But so that the user doesn't have to wait for a web response for every button they press/every activity launch, I have a sqlite database attached to the app which stores the live information as the app is being used (It uses GPS tracking so this data is stored as well as other things).
I suppose my question is, how much should I store locally to be uploaded later? Should I try and do everything locally after initially logging the user in and just uploading/syncing the data in the user's profile onPause() or something and make use of the lifecycle? Or should I do the opposite and try and do everything live online and get rid of the local sqlite database altogether?
Just wondering if anyone has had experience with this kind of situation and what conclusions they came to.
Thanks for your time,
Infinitifizz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
mobigroup< 上有一些用于同步 SQLite 数据库的
sqlite3-rdiff
工具。 /a>There are some
sqlite3-rdiff
tools for syncing SQLite databases at mobigroup