2

I am missing some logic in my app. I am having json webservice which can be modiy by administrator.For the first launch of my app I am storing the data from the webservice and stores in sqlite and displays the data from sqlite using background threads.If it is second time launch then the app directly displays the sqlite data. Now the problem is if it is for the second time launch of the app how can I recognize the webservice got modified and where it is modified and how can I store the particular record?

For that I am comparing with the id's of the book in sqlite and webservice if new book enters I am able to get the new item and store it in the sqlite and display them from sqlite.But if there is any modifications in item details how can I recognize the particular tag?

Lain
  • 2,166
  • 4
  • 23
  • 47

1 Answers1

0

Write a REST API on your web server that will send you a list of modified records. Query this API every time you start your app.

If there are modified records, This API should return you a list of the modified records which you can use to update your local sqlite database.

If not, then this API will return nothing and you can carry on happily :-)

You can create REST API's by writing server side code using a language like PHP, Ruby, Python etc

There are other options that avoid REST API's as well. See:

How to get from a MySql server to an Android app?

See here for a beginners tutorial on REST:

http://net.tutsplus.com/tutorials/other/a-beginners-introduction-to-http-and-rest/

Community
  • 1
  • 1
Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84