Li Che Li Che - 5 months ago 58
Android Question

Android webview apply start too slowly.

I created an android application. It uses a

WebView
to upload local html. But it starts very slowly. It uploads the page in about 10 seconds. Why it is so slow? What method can let the application starts faster?

Answer

Try using this - This will enable cache in your webview thus might 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 snippet is for loading any page faster, if you specifically want to load local pages only try using example explained on This Link.