0

I have an Android app on the play store which uses a local SQLite DB on the device.

However, in a planned update, I want to sync the SQLite DB with an external MySQL server with the same table and database structure, through a PHP webservice.

However, in this case, I not only want to make sure the changes in my SQLite DB are reflected in my MySQL DB, I also want to make sure that the changes in my MySQL DB get reflected in the SQLite.

Would appriciate any suggestions about how to go about it.

Ayush Gupta
  • 8,716
  • 8
  • 59
  • 92

2 Answers2

0

When you call method of web service for update external MySQL server, this method can return result of this update to Android client.

  • yes, but what about a user has an app on two devices, synceed to the same Google account.. the changed made in one app should should be reflected in the second, so i need to replicate the chngesin the MySQL DB to the app too. – Ayush Gupta Apr 19 '16 at 12:49
  • Also, what about the existing rows and tables. – Ayush Gupta Apr 19 '16 at 12:49
  • You didn't specify what kind of update are you doing. I suppose SQL UDATE command, so existing rows and table are not handled. You wanted to make sure that changes reflected. What do you comment, is reading status of changed data. If you need to be announced of data changes, you need to read them periodically. Or maybe use some kind of [push](https://parse.com/tutorials/android-push-notifications). But I don't use it, so have no additional info. – Milan Tůma Apr 19 '16 at 13:13
0

please refer this link and check first two tutorial . it may solve your problem

Basi
  • 3,009
  • 23
  • 28