T
T
TaTIk942016-09-19 17:13:06
Java
TaTIk94, 2016-09-19 17:13:06

How to speed up WebView?


There is a site in it there is a 3D walk section created using Js, so I connected to it via Webview, but the thing is, there are brakes moving very slowly ... is it possible to speed it up somehow?

// Enable Javascript
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);

        //metodi optimizacii
        mWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
        mWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        mWebView.getSettings().setAppCacheEnabled(true);
        mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        webSettings.setDomStorageEnabled(true);
        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
        webSettings.setUseWideViewPort(true);
        webSettings.setSavePassword(true);
        webSettings.setSaveFormData(true);
        webSettings.setEnableSmoothTransition(true);





        // Force links and redirects to open in the WebView instead of in a browser
        mWebView.setWebViewClient(new WebViewClient());

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Stolyarov, 2016-09-19
@TaTIk94

Alas, real-time rendering through WebView is not particularly friendly with performance, and also on mobile. device.
The best option to ensure proper performance is to rewrite under the NDK

M
mitaichik, 2016-09-19
@mitaichik

stackoverflow.com/questions/7422427/android-webview...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question