views:

124

answers:

1

I'm generating a pretty big sqlite-file on a server (about30'000 entries, it's about 3mb big) and would like to use that data in my iPhone application.

The sqlite-file on the server is generated every hour; some of the data is changing nearly everytime, some of the data changes only rarely.

Is there a way only to send the changed data to the iPhone as I do not want to let the user load 3mb every time he uses the application.

What can I do to only send the data to the client that changed since the last time he asked for it? Any ideas?

+3  A: 

Keep a timestamp for each iPhone that requests the data, and then use that to determine which rows have changed since the last time the iPhone asked.

Alternatively, the iPhone can send a timestamp of when it last asked for the data the next time it asks.

You will also need to store a last updated timestamp for each row in the database, so you can determine which ones have changed since the iPhone last asked.

Richard
thx richard, that's a good starting point. so in my app bundle i deliver the starting point of the database and i always know which data has changed on the server. but then i have to sqlite-files (one on the server, one on the client) - what's the best way to update the iphone-sqlite-db with the necessary rows from the server?
swalkner
One way would be to generate a CSV file on the server that contains the changed/updated data. Then on the iphone read this file and insert each row into the iphone's database.
Richard