Reputation: 351
This is the logic which I did on my application when the activity is opened first time :
And logic for Main Activity open the 2nd time
Sorry for my English or the question is duplicated. I just am finding a best way to work with data fetch from server. A big thanks if anybody give me a example how to handle it.
Upvotes: 0
Views: 429
Reputation: 6978
Your approach is fairly simple and acceptable if you are dealing with a small data set (say less then 100 values).
However for large data sets consider building some kind of sync mechanism where you ask server only for the difference of data you have locally and data available on server.
one way of doing it is to maintain a sync key.
in this approach server will have to maintain change history but it will be efficient for mobile client with respect to data base and network.
Upvotes: 1
Reputation: 628
Take a data as a primary key which is unique comes from server end.
Upvotes: 5