Rajeev Vyas
Rajeev Vyas

Reputation: 182

Suggestions for Sync data from server to android device

I have developed an android app and json api in php. App uses json api hosted on server to receive data which are list of products(food items) and users in app can rate those items,share e.t.c

Products are managed in php in web interface developed.

My question is that whenever a product data changes i want apps to update those data, not every time but batch update.

And for images of products i want only those images to be downloaded by apps that have been changed.

Any Suggestions for achieving this in easy way , so that apps does not have much load in synching data...

Upvotes: 0

Views: 690

Answers (2)

Add last_modified_date field in every table and manage images in separate table. You have to maintain last_sync_date while calling web service. In web service you need to pass the last_sync_date. Depends on last_sync_date the modified data can be sent to app.

Upvotes: 0

Chirag
Chirag

Reputation: 56925

For that you need to take one field at server side called updated_date. It will change when any data is changed at server side.

So when you call the webservice for updated data you need to pass the last sync time(every time you need to store the last sync time in your application shared preference) to server, so server will take that time and send data back which are updated after that time.

I think this is the simple way for your requirement.

Upvotes: 1

Related Questions