开发者

how to request only new or changed co-ordinates from a servlet?

I have a list of co-ordinates on my server. I want the android phone to request the list from a servlet when it first time it is ran. Then if i put a new co-ordinates in the list , i want the phone to only download the new co-ordinates.

How would i go about 开发者_如何学Cdoing this?


you have to track the time of co-ordinates added. And to save last time when android client access you servlet. Next you call /yourServlet?takenewfrom=lastaccessdate
On the server side use sql select "where timeadded>?" or sortable collection.


There could be more than one approach to tackle the problem. For eg. For the first time when android client client download list send parameter list = freshdata and from next time just download the changed data by sending list = changeddata

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜