Reputation: 437
Howdy, I'm currentyl new to Java and Android but I would like to write an App which checks a webserver on a particular file. If that file is NEWER than the locally saved file it should go ahead and download the file.
Now I've already got the download in place .. but I don't know how I can check the file on the webserver. Any help would be appreciated! :)
Upvotes: 1
Views: 419
Reputation: 11640
Look into sending your request with an If-Modified-Since
header. This makes your request conditional based on the resource you are requesting. If it hasn't been updated since that time, it will return a 304.
See Section 14.25 of this page for more details.
Upvotes: 2