Android Question problem with webview "javascript"

emilio_00

New Member
Hi
i creat a simple code how let user to access to a webapp "qr scanner"
the home page is loaded , but when i access the the page to use the qr scan, i got a white page.
the webapp work good on chrome and firefox

*************** the web page *******************


**************** Code ******************
B4xMainPage:

Private Sub B4XPage_Created (Root1 As B4XView)

Root = Root1
Root.LoadLayout("MainLayout")
billing.Initialize("billing")
WebView1.JavaScriptEnabled = True
WebView1.LoadUrl("https://darling-syrniki-098ddf.netlify.app/")

End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Looks like a problem in the website itself. If you add a WebViewChrome with WebViewExtras2 then you will see errors in the logs:
B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private WebView1 As WebView
    Private WebViewExtra As WebViewExtras
    Private WebViewClient As DefaultWebViewClient
    Private WebViewChrome As DefaultWebChromeClient
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    WebViewExtra.Initialize(WebView1)
    WebViewClient.Initialize("WebViewClient")
    WebViewExtra.SetWebViewClient(WebViewClient)
    WebViewChrome.Initialize("WebViewChrome")
    WebViewExtra.SetWebChromeClient(WebViewChrome)
    WebView1.LoadUrl("https://darling-syrniki-098ddf.netlify.app/")
End Sub

Private Sub WebViewClient_ReceivedError(ErrorCode As Int, Description As String, FailingUrl As String)
    Log(ErrorCode & ", " & Description & ", " & FailingUrl)
End Sub

Note that it is simple to scan QR codes and doesn't even need a permission: https://www.b4x.com/android/forum/t...imple-to-use-barcode-scanning.160725/#content
 
Upvote 0
Top