My app will ship with a local JSON file for the data, so that everything functions properly offline (because the region the app is based on is hit or miss on connections). I would like to be able to update the local file from time to time with an updated version that is hosted on a server.
Should I download the updated file and overwrite the local file with it, or is there a way to check to see if the file has been updated before downloading?
Also, what event would be best to do these type of tasks on? Downloading the file and overwriting the local copy every time the app runs seems like overkill, but I don't really know how I would go about checking the server file to see if the file is newer before downloading.
I'm new to programming in general, so I don't really know the best practices way to handle something like this.
Any help is appreciated.
Aucun commentaire:
Enregistrer un commentaire