Android Question Webkit rendering problem

gerardguerin

Member
Licensed User
Longtime User
I got a strange problem with the Webview, I have a app with that code:

B4X:
WebViewExtra1.Initialize(WebView1)  
WebView1.JavaScriptEnabled = True
WebView1.ZoomEnabled = False

WebSettings.setAppCacheEnabled(WebView1,True)
WebSettings.setSavePassword(WebView1,True)
WebSettings.setDOMStorageEnabled(WebView1,True)
  
Dim WebChromeClient1 As DefaultWebChromeClient
WebChromeClient1.Initialize("WebChromeClient1")
WebViewExtra1.SetWebChromeClient(WebChromeClient1)    
  
WebViewExtra1.addJavascriptInterface(WebView1, "B4A")  

WebViewExtra1.JavaScriptEnabled = True

WebView1.LoadUrl("https://app.planisport.com")

but in some case I got a partial screen, that depend I think of the version of SDK or the Webkit version

Won't work: Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36 (bad.png)

Work: Mozilla/5.0 (Linux; Android 4.4.2; Lead 3 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36 (ok.png)

Any idea??

Bad.png Ok.png
bad.png
ok.png
 

Attachments

  • ok.png
    ok.png
    62.7 KB · Views: 349
  • bad.png
    bad.png
    49.4 KB · Views: 408
Last edited:

eps

Expert
Licensed User
Longtime User
What does the HTML look like or at least the part you have posted screenshots for?

Are you using the same device for both? Probably not - in case which ones? Is it possible that the View or Activity isn't being created large enough to display all the information?

What webviewsettings libraries are you using and which version?
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
What webviewsettings libraries are you using and which version?

I use the buildin Webview in B4A v6.80 with WebViewExtra2 2.20, WebViewsSettings 1.31

Are you using the same device for both? Probably not - in case which ones? Is it possible that the View or Activity isn't being created large enough to display all the information?

Appareil SDK Manufacturer Model WebSettings
My Phone (Chrome)
24 samsung SM-G930F Mozilla/5.0 (Linux; Android 7.0; SAMSUNG SM-G930F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.0 Chrome/51.0.2704.106 Mobile Safari/537.36
My phone (app)
24 samsung SM-G930F Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36
Francis
21 samsung SGH-I337M Mozilla/5.0 (Linux; Android 5.0.1; SGH-I337M Build/LRX22C; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36
Richard Poirier
22 LGE Nexus 4 Mozilla/5.0 (Linux; Android 5.1.1; Nexus 4 Build/LMY48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36
Vicky
23 LGE LG-K210 Mozilla/5.0 (Linux; Android 6.0.1; LG-K210 Build/MXB48T; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36
Sandra
19 LEAGOO Lead 3 Mozilla/5.0 (Linux; Android 4.4.2; Lead 3 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Test Tablet
19 samsung SM-T230NU Mozilla/5.0 (Linux; Android 4.4.2; SM-T230NU Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Safari/537.36
Mere a Francis
19 LGE LG-D393 Mozilla/5.0 (Linux; Android 4.4.2; LG-D393 Build/KOT49I.D39310d) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
 
Upvote 0

eps

Expert
Licensed User
Longtime User
It's not entirely clear from what you've posted what all the webkits and versions are... Can you maybe split out those that work and those that don't please?

As far as I understand it, the webkit version is different between Android versions, although it could well be the same from 4.4 --> 7 but I wouldn't have thought it would be. Your post above seems to suggest that it is the same for all flavours - so there isn't an issue there.

It might be the way the device in question presents the screen to Apps.. (not likely in this scenario)

I would be tempted to check the way you are handling multiple screen layouts - e.g. have you got one layout and you modify that at runtime or a few and choose from those?

Also there seems to be a slight difference between the data returned on one screenshot to the other - the last, half item on the 'bad' screenshot isn't in the 'good' screenshot - so again something different there as well...

It's really hard to help without knowing any of your code or the data involved.
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
It's not entirely clear from what you've posted what all the webkits and versions are...
Oupss yours right, that was clear in my spreadsheet but here :(
In resume I have test on 9 different device, the app is just a simple browser that use the standard webview with the code in the first post, all device that work have Android 4.4.2 and report (user agent string Chrome 30) all other device that display just a partial screen have Android 5.0.1, 5.1.1, 6.0.1 and 7.0 with (user agent string Chrome 58)

I also try on my Samsung S7
- The app, got the display bug (user agent string: Android 7.0, Chrome 58.0.3029.83)
- Google Chrome Browser, that work well (user agent string: Android 7.0, Chrome 58.0.3029.83)
- Samsung Internet Browser, that work well (user agent string: Android 7.0, Chrome 51.0.2704.106)

If that work I get the screen at right in the first post
 
Upvote 0

eps

Expert
Licensed User
Longtime User
What webviewsettings have you enabled? Just the three mentioned? Should javascript be enabled?

Have you allowed logging of console.logs from javascript (are you using javascript in your HTML?). this is possible
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
What webviewsettings have you enabled? Just the three mentioned? Should javascript be enabled?
Yes Javascript is enabled, the same app on a Android 4.4.2 work very well

Have you allowed logging of console.logs from javascript (are you using javascript in your HTML?). this is possible
It not me that do the HTML and javascript, I will verify
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
Please use File - Export as zip when uploading projects.
OK it done, first time with this option, that great, more easy :)

Why are you using WebView for the interface? Why not create native interface instead?
The question is good, This makes it possible to quickly make a mobile web page based app and update content quickly.

B4A WebView is a thin wrapper over the native WebView.
Is there another 'Webview' available or a method.

I tested it on Android 7. It only showed the loading animation.
From Android 5.0.1 I have only a partial display as on the first image on post # 1
 
Upvote 0

BertI

Member
Licensed User
Longtime User
I know this is a somewhat old thread but I just happened to notice this issue myself. Since I have some control over the web site that is serving up the pages I thought to try putting the server into non secure mode, i.e such that the access URL is http://... rather than https://.. This appears to resolve the symptoms. So suggests it might be something to do with SSL (or is it TLS) handling maybe?
 
Upvote 0
Top