How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 02:17:51 GMT


Sponsored Links
 Hi,

I am want to use JavaScript to process some HTML pages in the background.

WebView seems to be a great basis to do this. There is one issue though. I
don't want to display the web page and its images/stylesheets right away, so
it is a waste of bandwidth when the stylesheets and images are downloaded. I
am wondering how to tell WebView not to do that.

I tried WebSettings.setLoadsImagesAutomatically(false), but this still loads
the stylesheets. WebView.setNetworkAvailable(false) is more an information
for WebView than a switch. Overriding
WebViewClient.shouldOverrideUrlLoading(..) didn't work either.

Any idea how to do this?

One thing that works is not giving the app the required Internet permission.
Unfortunately it is not that simple, because at other times I want to
display the processed pages and then it should download the
images/stylesheets ;-( But still is there some way that I can use this
permission thing? Can I dynamically revoke the permission? For a single
thread or process?

Cheers,

Mariano

--



How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 03:39:17 GMT


 >




Sounds good. I will try that.

--


Sponsored Links