Android web browsing is too slow.

I created an Android app. It uses WebView to load local html. But it starts very slowly. It loads the page in about 10 seconds. Why is it so slow? Which method can run the application faster?

+4
source share
3 answers

Try this - This will enable the cache in your web browser, so it can help you load pages faster.

  WebSettings webSettings = webview.getSettings(); webSettings.setPluginsEnabled(true); webSettings.setJavaScriptEnabled(true); webSettings.setDatabaseEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setAppCacheEnabled(true); webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); 

this fragment is designed to quickly load any page, if you specifically want to load local pages, try using the example described in this link.

0
source

Try using WebViewClient along with the web view and use the overridden method "shouldOverrideUrlLoading" and return accordingly.

0
source

Also, do you also have all external static resources locally in your application?

This is a common problem that users download HTML content locally, but its resources, such as JS, CSS, Fonts, etc., link to some http URLs. In addition to the Darpan solution above, you can also save your resource locally to make it even faster.

The following are setup instructions .

0
source

Source: https://habr.com/ru/post/1445004/


All Articles