I have apps that sync DB from sqlite to sqlserver in a website. The problem is that I need to sync both sides (server side and phone side).
It means when user insert/update/delete any data from web it should be reflected in phones and also when any change is made in phone’s DB it should be reflected on website.
Currently I’m using simple method. Which master tables are controlled by website and transaction are in Android phones. So when syncing process done. It remove all the master data from Android db and recreate all stuff. So it take a process. I only need that changes made on master tables on website and changes reflects on phone, that’s the method which i looking for.
Same way Android phone have transaction record when syncing, it remove all data form website and recreate.
So, how can i get only those records which is newly inserted or updated or deleted from Android phone as well as website….help me please…
I can give you a rough idea.
Use webserveices for this.
1)On server side save time stamp for every record that have modified (saved/deleted/updated).
2)Create a table which holds the table name and time stamp and records modified.
3)Your sever should generate all the data (operations performed) when pinged by phone with time stamp. (use flags (delete,update,insert) with records.
At Phone end
1) check the flag and do db operations accordingly.
The above is one part.
Now for synching data from phone to server
1) create a datapost method (better use json and post method of webservie), with data to be operated on with appropriate flags like that of above said method.
2)Process the server data after getting the data from phone.
But your design should also consider when single record on server can be modified by many users. If this is the requirement, then better directly do it from webapp, use webview on client side.