mysql - Last Modified or IfModifiedSince Android SQL HTTP -


i have app retrieves , posts data sql server.

my situation this: set download json data server every time app opened. server (1000's of rows , 15+ columns) data updated every couple of days or few times week. seems inefficient , silly update every time app opened if data hasn't changed.

i want data update if data has been updated.

i'm trying use this:

urlconnection = (httpurlconnection) url.openconnection(); long lastmodified = urlconnection.getlastmodified(); 

it seems returning 0, means value not set?

do need set on server allow respond getlastmodified request?

note: able see last updated statistic on phpmyadmin.

you other things instead :

  • you add new table or new field have date last modified date , , let app info , compare local date , , decide eather update or not .

  • you deal meta data idk if sql server .

  • or can set service on android device update data base every 2 days way not efficient .


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -