开发者

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

开发者 https://www.devze.com 2023-03-13 00:35 出处:网络
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.

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

精彩评论

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