Sub Activity_Create(FirstTime As Boolean)
URL1="www.xxxxxxxxxxxxx.com"
Timer1.Initialize("Timer1",300000)
WebView1.Initialize("WB1")
Activity.AddView(WebView1, 0,250dip,100%x,100%y-250dip)
WebView1.JavaScriptEnabled = True
WebViewExtras1.Initialize(WebView1)
WebViewExtras1.JavaScriptEnabled = True
JS.Initialize
WebViewExtras1.AddJavascriptInterface(JS, "B4A")
end sub
Sub WB1_PageFinished(URL As String)
ToastMessageShow("Load " & URL ,False )
Dim script As String
script = "B4A.CallSub('ProcessHTML', true, document.documentElement.outerHTML)"
WebViewExtras1.ExecuteJavascript(script)
End Sub
Sub LoadPageX
'--- delete cache
Dim o As Reflector
o.Target = WebView1
o.RunMethod2("clearCache","True","java.lang.boolean")
WebView1.LoadUrl(URL1)
Sleep(0)
End Sub
Sub Timer1_tick
LoadPageX
End Sub
Sub ProcessHTML(Html As String)
' This is the Sub that we'll get the web page to send it's HTML content to
' Log may truncate a large page so you'll not see all of the HTML in the log but the 'html' String should still contain all of the web page HTML
Dim sf As StringFunctions
Dim L As Long
sf.Initialize
LogColor(Html,Colors.blue )
L=sf.Len(Html)
LogColor("L=" & L,Colors.Blue)
If L>2300 Then
' VERY LONG BEEP
End If
End Sub