mysql 主从复制 sqlite,如何从Android的复制SQLite数据库MySQL数据库 - 复制 - 同步

I am building an Android app which will take some data and images from user and store them in a local SQLite DB. What i am looking forward to is a way by which i can replicate this DB to a MySQL DB on my server.

I looked on the Internet for the answer but there isn't a proper solution to it. Though the most common answers i found were SymmetricDB and Setting up a Webservice. I am still confused which route to take.

The SQLite DB may also at need, have to pull updated data from the MYSQL DB, so i guess the better word to use is Sync rather than Replicate.

Any help?

解决方案

Yes of course, its Sync.

You have to create Web Service for that.

Just follow some steps for sending data from Android to MySQL:

Create JSON object of your data using JSONObject and JSONArray class.

post that as an string to your Web Service that might be in PHP or whatever you prefered.

process to parse json and insert data in to MySQL database.

Same as from MySQL to Android:

Create Web Service that displays your data in JSON Format.

then you have to Request to that link and you'll get JSON data, just you have to parse and store into SQLite.

You have to take care about Data Confiction. for that you have to take one that store some value both side like last sync date/time.

There are some tutorial that will help for android JSON Parsing and PHP JSON Parsing.

If there is any problem then you can free to ping.

Happy Syncing.

Thank you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断路器保护灵敏度校验整改及剩余电流监测试点应用站用交流系统断

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值