Android Question Very poor webview performance

Hi
I'm loading a local html in a webview, but the webview is extremely slow. I tried adding hardware accelerating to manifest, and everything else found in forum. But none of them worked.

I uploaded my project. if that helps.

Also there's only a webview in my activity. nothing else

This is one of my HTMLs
HTML:
<html><head><meta name="viewport" content="width=device-width, user-scalable=no"><style>
html,body{margin:auto;}#image{
width: 100vw;
}
</style></head>
<body>
<html>
<head></head>
<body>
  <p dir="ltr" style="word-wrap: break-word;">Test<br> <img src="file:///android_asset/assets/ResContent/513352269" id="image"></p>
  <p dir="ltr" style="word-wrap: break-word;">Test 2<br> Testtttt</p>
  <p dir="ltr" style="word-wrap: break-word;"><img src="file:///android_asset/assets/ResContent/456140717" id="image"><br> Test 3</p>
</body>
</html>
</body></html>

My project is too large (1MB) for the forum. so i uploaded it in google drive:

I tested it on release mode, on a real device and ...
It's always slow

Please help.
 

JohnC

Expert
Licensed User
Longtime User
I didn't see a link to your source code, but did you try adding the chrome client to webview:
B4X:
Dim wv as WebView
Dim wve as WebViewExtras
wve.addWebChromeClient(wv, "WVE")
 
Last edited:
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Also, try copying the files from the assets to another dir to see if that speeds things up as in #2 of this post:

 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Also, I just noticed that your HTML has multiple body, head and html tags - try fixing those too.
 
Upvote 0
Top