Home » Android » How to make a android WebView load faster?

How to make a android WebView load faster?

Posted by: admin May 14, 2020 Leave a comment

Questions:

Anybody has some suggestions to make a webview faster to load the url?

In my situation, I am using the jQuery’s getScript to load the javascript(s) when needed.

Thanks,
Sana.

How to&Answers:

This might not be suitable for your situation, but you could ignore loading images.

       webview.getSettings().setBlockNetworkImage(true);

if targeting api level 8 (2.2) or higher you can take one step further and

       webview.getSettings().setBlockNetworkLoads(true);

More: WebSettings | Android Developers

Answer:

There is some built-in overhead to using a web view that cannot be avoided. Beyond that, if you are loading the web page from an external url, there is the time the network takes to load the web page, which also cannot be avoided in general. If there are some specifics to the problem that you think would lend themselves to being optimized, you haven’t mentioned them. If you’re asking if there is an easy way to make loading a web view “go faster”, the answer is no.

Answer:

you can just remove the www in you url ..
it will make you webview to work faster..

example
mWebView.loadUrl(“http://googele.com“);