How Copy SQLite database from Android to a MySQL database - Replicate - Sync [duplicate]

断了今生、忘了曾经 提交于 2019-11-28 07:52:48

Yes of course, its Sync.

You have to create Web Service for that.

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

  1. Create JSON object of your data using JSONObject and JSONArray class.
  2. post that as an string to your Web Service that might be in PHP or whatever you prefered.
  3. process to parse json and insert data in to MySQL database.

Same as from MySQL to Android:

  1. Create Web Service that displays your data in JSON Format.
  2. 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.

  1. For Android
  2. For PHP

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

Happy Syncing.

Thank you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!