I want to query the server to see if the date is different than the one I have on the phone
that I previously downloaded. I want to keep from un-necessarily downloading the image again if I already have it. Looking for a way to get remote URL file date AND time without downloading the image again. Code Below that fetches all.
File root = Environment.getExternalStorageDirectory();
URL u = new URL(url);
HttpURLConnection c = (HttpURLConnection) u.openConnection();
c.setRequestMethod("GET");
c.setDoOutput(true);
c.connect();
InputStream in = c.getInputStream();
Drawable d = Drawable.createFromStream(in, "src name");
printi("Content length",c.getContentLength());
1 Answer