Quote:
Originally Posted by SadGeek
Thanks dageshi, what are your plans with the update. Download everything in the background and then update the lot when the user next starts up the App. I don't think you're planning to do this but if you updated via seperate thread then you would have to store temp versions of the data. e.g. A performs a search, 5 products come back (but in the background the product A has been deleted). So if the user taps Product A there is now no such record. So as I you say, updating in one go is the best approach.
Many thanks for you post.
|
Due the amount of data involved and more importantly the relative slow access speeds to the iphone flash memory (or so it seems to me) when the updates are ready I ask them if they want to update now and then throw up a update progress screen in a modal view. Updgrade proceeds and then window closes.
My app is a travel guide based on wikitravel.org data, the data is all the wikitravel info for an entire country. For China that runs to about 55MB including 50-60 images at 1024x786 each. In that there is about 5MB+ of just text based content split up over several thousand entries. Updating that lot + tags and other data takes a fair amount of time unfortunately especially since sqlite indexes don't help they actually hinder.
The only other approach I can suggest for you is that you could do a hybrid version. Download and insert the data into the database as you get it in the background, but have a special field that marks each row as "active" or "inactive" when you've downloaded it all you can mark everything from inactive to active in one go and delete your old entries. I'm guessing this might be alot quicker, less intrustive in your circumstances. So basically
1) send client last sync date to server
2) server sends back list of primary keys that need updating
3) client starts to download these in the background and saves them to the db marking them as "inactive"
4) either at startup or maybe in iOS 4 when the app goes into the background, mark all the inactive rows as active and delete those that need deleting.
I think doing it at startup is the best option though.