HTML5 Application using AppCache in WebView

Hi everyone,

I’m developing a simple wrapper using Corona SDK, which opens up my html5 app using native.newWebView(). This works fine except for the fact that the appcache feature does not seem to work. I’m testing this on an actual device since the simulator doesn’t have webviews, and my app works perfectly within Chrome on Android, so I’m pretty sure I have all the correct syntax in my html files as well as in my manifest file. I’ve checked to see that my webserver is serving the correct mime type for .appcache files also. If an internet connection isn’t available, rather than loading the cached version, the webview just shows a “Webpage not available” screen with the error net::ERR_ADDRESS_UNREACHABLE or net::ERR_NAME_NOT_RESOLVED. Is there some way to make the webview operate like Chrome does? 

Thanks so much for any help you give me, I’ve been racking my brain about this forever and for the life of me can’t understand why this wouldn’t work.

Here’s the relevant part of my main.lua (pretty simple):

display.setDefault(“background”,0/255,0/255,0/255)

webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 470 )

webView:request( “http://my-app.com/app.php” )

And here’s my manifest file, included with: [html manifest=“ts_manifest.appcache”]

CACHE MANIFEST

#2
offline_view.html

NETWORK:
*
http://*

anyone…?

Let me ask our engineers.

Rob

thanks for your help, Rob.

Our Android webView does not support appCache. The engineer that I spoke to asked me to have you file a bug report with an example HTML5 page that needs appCache and they can consider adding it sometime in the future and have this as a reference. The feature is not expected to be added soon though.

Rob

Alright, I will file a bug report. I was able to get the functionality that I needed using other means, so it isn’t really an issue for me anymore, but I was basically using the AppCache for offline functionality of my app, which also depends on using localstorage, which is domain specific - that’s why I wanted to use a page that was being loaded from an AppCache entry.

I recognize that this isn’t currently a high priority, and as I just said, I was able to get the functionality I needed through other means, but you still may want to mention to the engineers that this is certainly possible with the standard android sdk: http://stackoverflow.com/questions/30090047/appcache-correct-settings-for-android-webview?rq=1

Quick follow-up question: does your iOS webView support appCache?

From a quick check of some google links, it sounds like UIWebView supports it at least in more modern OS’s. And if you’ve set up your manifest file it should cache the files for you. See: http://stackoverflow.com/questions/8152185/offline-html5-in-a-uiwebview/8187547

Now be aware, Apple likes to reject apps that are just webViews.

Rob

anyone…?

Let me ask our engineers.

Rob

thanks for your help, Rob.

Our Android webView does not support appCache. The engineer that I spoke to asked me to have you file a bug report with an example HTML5 page that needs appCache and they can consider adding it sometime in the future and have this as a reference. The feature is not expected to be added soon though.

Rob

Alright, I will file a bug report. I was able to get the functionality that I needed using other means, so it isn’t really an issue for me anymore, but I was basically using the AppCache for offline functionality of my app, which also depends on using localstorage, which is domain specific - that’s why I wanted to use a page that was being loaded from an AppCache entry.

I recognize that this isn’t currently a high priority, and as I just said, I was able to get the functionality I needed through other means, but you still may want to mention to the engineers that this is certainly possible with the standard android sdk: http://stackoverflow.com/questions/30090047/appcache-correct-settings-for-android-webview?rq=1

Quick follow-up question: does your iOS webView support appCache?

From a quick check of some google links, it sounds like UIWebView supports it at least in more modern OS’s. And if you’ve set up your manifest file it should cache the files for you. See: http://stackoverflow.com/questions/8152185/offline-html5-in-a-uiwebview/8187547

Now be aware, Apple likes to reject apps that are just webViews.

Rob