如何将 Android 手机上的 SQLite 数据库与服务器上的 MySQL 数据库同步? [英] How to sync SQLite database on Android phone with MySQL database on server?

查看:40
本文介绍了如何将 Android 手机上的 SQLite 数据库与服务器上的 MySQL 数据库同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个安卓应用程序.我想用服务器上的 MySQL 数据库更新本地 SQLite 数据库.我无法弄清楚最合适和最标准化的方法是什么?

I am developing an android application. I want to update the local SQLite database with MySQL database on server. I am not able to figure out that what is the most appropriate and standardized way to do so?

推荐答案

创建一个 Web 服务(REST 可能是最好的)并序列化您的 SQLite/MySQL 数据,然后将其 PUT/POST/GET 到您的 Web 服务/从您的 Web 服务获取.如果您决定从 MySQL 切换到其他服务器端,这将为您提供一个很好的抽象层.

Create a webservice (REST is probably best) and serialize your SQLite/MySQL data and PUT/POST/GET it to/from your web service. This will give you a nice layer of abstraction in case you decide to switch from MySQL to something else server side.

这篇关于如何将 Android 手机上的 SQLite 数据库与服务器上的 MySQL 数据库同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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