Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim flashair_url As String = "http://flashair/SD_WLAN/rwlast3.htm"
Dim now As Long
DateTime.TimeFormat = "HH:mm:ss:SS"
Dim js As String = "B4A.CallSub('ProcessLastLine',true,document.getElementById('main').innerHTML)"
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim WebView1 As WebView
Dim wve As WebViewExtras
Dim pws As PhoneWakeState
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("main")
Activity.Title = "Flash Air WIFI SD Card - V3"
pws.KeepAlive(True)
wve.addJavascriptInterface(WebView1,"B4A")
wve.addWebChromeClient(WebView1,"wve")
now = DateTime.now
Log(DateTime.time(now))
WebView1.LoadUrl(flashair_url)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
pws.ReleaseKeepAlive
Activity.Finish
ExitApplication
Return True
Else
Return False
End If
End Sub
Sub WebView1_PageFinished (Url As String)
now = DateTime.now
Log(DateTime.time(now))
wve.executeJavascript(WebView1,js)
End Sub
Sub WebView1_OverrideUrl (Url As String) As Boolean
End Sub
Sub ProcessLastLine(html As String)
Log(html)
Dim flds() As String
flds = Regex.Split(",",html)
End Sub