如何同步在Android手机的SQLite数据库服务器上的MySQL数据库?
问题描述:
我开发一个Android应用程序。我想更新与服务器的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 /它到/从您的网络服务。这会给你的情况下,你决定从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.