Kevin
Kevin

Reputation: 2585

android caching web service data

I'd like to make my Android app responsive, even when the network connection is not.

For certain calls, the data doesn't change that often, so I'd like to be able to retrieve the most recent XML response for a given call.

Ideally, I'd like to do this similar to how web caching works, hash the call/params, set rules as to expiry, etc.

Upvotes: 5

Views: 1932

Answers (2)

Zsombor Erdődy-Nagy
Zsombor Erdődy-Nagy

Reputation: 16914

Check this session out, it has some interesting info on this topic http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html

Tho he doesn't speak about cache expiration, but it's a good start.

Edit:

As pointed out, the link above is not working anymore, here are the updated links:

Slides

Video

Though this content is a few years old, so I'd recommend looking around for more recent material on this subject as well.

Upvotes: 1

BlackDragonBE
BlackDragonBE

Reputation: 302

Can't you just save the received xml locally and then read that file when there's no internet connection?

Upvotes: 1

Related Questions