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


Other Threads

1. Best way to scale for different screen resolutions/dimensions?

I have a class that extends LinearLayout and handles drawing to the
screen.  (it is in the early stages)  How would I go about determining
the dimensions of a screen and resizing the images, etc., that this
class is drawing to the screen on the fly before actually drawing them
to the screen?

What I'm trying to accomplish is support for devices that have varying
screen dimensions and resolutions from the same code base, with each
device being scaled properly..

Thank you for any pointers..

PD

-- 

2. get all applications supporting a specific format.

HI all,

      Is there any way i can get all the applications installed on the
device that support a specific format. Like if i have a docx file and
3 applications on the device that support it, can i get those 3
application names so that the user can choose which one to launch.

Thanks in advance.

-- 

3. Forwarding ranges of ports to the Android emulator

4. Larger screen support

5. Problem with reading contacts on Samsung Galaxy Europa

6. Update WTS : Androids 2nd.

7. MotoDroid Susah SMS