Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

offline app using UIWebview for iPad

I am trying to build an iPad app which has one UIWebview. content is in asp.net. Now one of major requirement is that my app should support offline mode.

First I tried looking Html5 cache manifest but as per this SO Answer it does not work with UIWebview

Then I tried searching around caching mechanism available with UIWebview, I found many question on SO(This,This,This,This) but nothing comes to conclusion or may be old in this context.
my basic requirement is whichever page user browse that should get cache(html,css,js.images) and next time when user visit the same page it should be delivered from cache.

So my questions are
1) How do achieve this using either Html5 cache manifest or UIWebview caching
2) My app uses lots of image some of them are in MB so is there any size limitation

I would really appreciate if anybody can provide a complete tutorial reference. Thanks.
**UPDATE: ** is it possible i can take advantage of local disk cache(for images) and html5 local storage (for data) together? if yes then how do i provide local image path.?

like image 729
Nnp Avatar asked Oct 05 '10 21:10

Nnp


3 Answers

I would give ASIWebPageRequest a try. It's still listed as experimental, so it's not quite fully baked, but it's meant to do precisely what you're asking for.

like image 130
Kris Markel Avatar answered Oct 14 '22 21:10

Kris Markel


You can use HTML5 Offline storage to store your app code and data.However you still need a simple bootstrapper js code to load the app (basically eval) from offline storage. You can also store small images (base64 encoded) in offline storage. The downside is you have to roll your own versioning and update local storage if there's a newer version of the app.

like image 24
Ibrahim Okuyucu Avatar answered Oct 14 '22 23:10

Ibrahim Okuyucu


It looks like the reference referred to in your question is no longer relevant

First I tried looking Html5 cache manifest but as per this SO Answer it does not work with UIWebview

The latest accepted answer for that question indicates that HTML5 cache manifest is supported for UIWebView as of iOS 4.0 as long as the mime type of your manifest file is properly set as text/cache-manifest.

like image 40
Krease Avatar answered Oct 14 '22 23:10

Krease