Android Question Webview does not load page

invaderwt

Member
Licensed User
Longtime User
B4X:
Activity.LoadLayout("Layout1")
   WebView1.LoadUrl("https://europlusfrontb2b.cangooroodns.com.br/")




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 https As String
   https = "https://europlusfrontb2b.cangooroodns.com.br/"

   WebView1.LoadUrl(https)
   Dim job2 As HttpJob
   job2.Initialize("Job2", Me)
   job2.Download(https)
 
   'Log(WebView1.Url)
End Sub

Sub Activity_Resume
 
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub JobDone (Job As HttpJob)
   Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
   If Job.Success = True Then
       Select Job.JobName
           Case "Job1"
               'print the result to the logs
               Log(Job.GetString)
           Case "Job3"
               'show the downloaded image
               Activity.SetBackgroundImage(Job.GetBitmap)
           Case "Job2"
               'show the downloaded image
               WebView1.LoadHtml(Job.GetString)
               Log(Job.GetString)
       End Select
   Else
       Log("Error: " & Job.ErrorMessage)
       ToastMessageShow("Error: " & Job.ErrorMessage, True)
   End If
   Job.Release
End Sub
B4X:
Logger conectado a:  LGE LG-M250

** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Timeline: Activity_idle id: android.os.BinderProxy@98527d4 time:29970885
JobName = Job2, Success = true
[INFO:CONSOLE(9)] "Uncaught Error: jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.", source: https://frontwebapi.cangooroo.net/scripts/jquery.signalR-2.2.1.min.js (9)
JobName = Job2, Success = true
[INFO:CONSOLE(9)] "Uncaught Error: jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.", source: https://frontwebapi.cangooroo.net/scripts/jquery.signalR-2.2.1.min.js (9)
Log reader error: java.io.InterruptedIOException: read interrupted
-1 received
writer error
java.lang.InterruptedException
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2010)
   at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2044)
   at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:358)
   at anywheresoftware.b4a.remotelogger.Connector$Writer.run(Connector.java:160)
   at java.lang.Thread.run(Thread.java:761)
Starting remote logger. Port: 35352
After accept
[INFO:CONSOLE(16)] "Uncaught TypeError: Cannot read property 'signalR' of undefined", source: https://frontwebapi.cangooroo.net/signalr/hubs (16)


[INFO:CONSOLE(5)] "Error: [$compile:tpload] http://errors.angularjs.org/1.6.8/$compile/tpload?p0=/common/views/home-c489f594b5.html&p1=undefined&p2=undefined", source: https://europlusfrontb2b.cangooroodns.com.br/dist/assets/all_angular_v1-3f3f2de138.js (5)


This browser does not support Web Storage
I try by this two ways and not loading. how I can solve?
Thank
 
Last edited:

Jorge M A

Well-Known Member
Licensed User
Longtime User
Please use [CODE ] [ /CODE] Tags to write your code. There is an icon there.

What is "https"?, in
B4X:
WebView1.LoadUrl(https)
 
Upvote 0

Jorge M A

Well-Known Member
Licensed User
Longtime User
Please check and try this library web view settings
Configure it accordingly your site needs.
There are many examples in the forum.
 
Upvote 0

Jorge M A

Well-Known Member
Licensed User
Longtime User
Relevant sample code, working with your url, in accordance to original question:

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private WebView1 As WebView
    
    Private webViewSettings As WebViewSettings
    Private url As String="https://europlusfrontb2b.cangooroodns.com.br/"
    
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("1")
    
    
    Dim WebView1 As WebView
    WebView1.Initialize("")
    WebView1.JavaScriptEnabled = True
    WebView1.ZoomEnabled = False

    
    webViewSettings.setAppCacheEnabled(WebView1, True)
    webViewSettings.setSavePassword(WebView1,True)
    webViewSettings.setDOMStorageEnabled(WebView1,True)
  
    Activity.AddView(WebView1, 0, 0, 100%x, 100%y)
    
    WebView1.LoadUrl(url)
    
End Sub

References: WebViewSettings V1.31
 
Upvote 0
Top