简体   繁体   中英

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.

你不能只在本地保存收到的xml,然后在没有互联网连接时读取该文件吗?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM