Friday, May 3, 2013

[android help] Android webview cache force loading


This might be a very trivial question with android webviews, but I am not getting good and clear material online to understand the concept. I am trying to build a webview android app that connects to a server initailly, downloads the HTML/JS/CSS data to local cache (getCacheDir) and serves the content from there. Any server call from the webview goes out to the server and results are returned and interpretted. But the assets are loaded from the local webview cache. The next time app is launched, there is some logic that checks if the version of the downloadable assets have changed, and in that case new package is downloded and replaced in the cache. If ther is no change, the content is served from the cache.


Now what I have the following questions: is the webview cache same as application cache (set vai getCacheDir() ) as in webview we do



webview.getSettings.setAppCachePath(getCacheDir().getAbsolutePath(+"/cache");


can i force the webview to load from cache VS network (using LOAD_CACHE_ELSE_NETWORK and LOAD_DEFAULT)


I am a bit confused. Please clarify these concepts?



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...