Android Question webview white page !

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Hello,
I have a simple webview that should load https website , i got white page & website not loading!
In chrome it open smoothly.

Any suggestion ...
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Where's your example code gone from yesterday @HAH?

I tried it and it was blank, other sites worked in webview but that one site didn't, and yes that site works perfect in desktop browsers.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use File - Export as zip when uploading projects.

Check the unfiltered logs:
Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

This error means that Android doesn't recognize this site certificate.

Solution that ignores all certificates, based on WebViewExtras2:
B4X:
Sub Globals
   Private WebView1 As WebView
   Dim wve As WebViewExtras
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("Layout1")
   
   Dim c As DefaultWebViewClient
   c.Initialize("client")
   wve.Initialize(WebView1)
   wve.SetWebViewClient(c)   
   WebView1.LoadUrl("http://yesmallz.com/")
End Sub

Sub client_ReceivedSslError(SslErrorHandler1 As SslErrorHandler, SslError1 As SslError)
   Log(SslError1)
   SslErrorHandler1.Proceed
End Sub
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Sub client_ReceivedSslError(SslErrorHandler1 As SslErrorHandler, SslError1 As SslError)
Log(SslError1)
SslErrorHandler1.Proceed

End Sub
Excellent, worked fine

Mr. @Erel ; I don't find this event client_ReceivedSslError in b4x forum (not mentioned before)!!! How you create it from nothing?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I don't find this event client_ReceivedSslError in b4x forum (not mentioned before)
LOOOOL?

https://www.b4x.com/android/forum/pages/results/?query=ReceivedSslError

How you create it from nothing?
Lean the language.

write SUB + space, press TAB, write for exymple "webview"

I only know an german thread from Klaus. but i´m sure there is a similar one in english somewhere...

https://www.b4x.com/android/forum/threads/ide-tipps.7279/

Also note that this is a feature since years and something your should know.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Excellent, worked fine

Mr. @Erel ; I don't find this event client_ReceivedSslError in b4x forum (not mentioned before)!!! How you create it from nothing?

Please watch the following video, about half way through Erel talks about 'Event Sub Signatures' and how to find/create them once you have selected the correct library.

https://www.b4x.com/android/forum/threads/b4x-video-ide-tips.88155/

This information is also available in the PDF guide by Klaus, you can download the manuals from the forum, search for ''ide tips'.

Enjoy...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…