Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have an application with a configuration file that is stored in the application bundle. This config file stores the names of images on a remote server. Whenever the application is started, I download the configuration file from the server and see if there are any changes or updates. If there are changes, I iterate over the array of configuration settings and download the changed images to the user's iPhone

I think that I will first list all of the name changes in an array, and after that start loading that changed images. However, I'm wondering if there is a better approach to solving this problem.

share|improve this question
    
Are you asking if there is a better way to communicate image changes to the phone, or if there is a better choice to reading the config file than loading the changes into an array? –  Joshua Drake Apr 5 '12 at 21:02
    
@JoshuaDrake first one –  hib Apr 6 '12 at 6:01
    
Are you checking that the config file itself has been updated before downloading it? –  Joshua Drake Apr 6 '12 at 13:00
    
@JoshuaDrake No I have to download it first an then check the version of the config file with the one on the device –  hib Apr 6 '12 at 13:41
    
No way to check the timestamp on it beforehand? Such as having an update service you call to check if an update is needed. –  Joshua Drake Apr 6 '12 at 13:44

2 Answers 2

up vote 1 down vote accepted

One simple way to save bandwidth without much modification, would be to use the If-Modified-Since header in your download request. Then continue to check the version number inside the file anytime it is downloaded, just in case the modified date on the file gets changed accidentally.

share|improve this answer
    
I can not try your answer now .. but as per my knowledge your suggestion looks the perfect. –  hib Oct 11 '12 at 13:49

You may want to use a simple version number attached to/near the file. Compare the server and client number (very low bandwidth usage) and work with it.

Version numbers can help you apply incremental upgrades to your config file to add/change/remove entries.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.