is it possible to save webview html file for offline reading
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim myInterface As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layoutMain")
myInterface.addJavascriptInterface(WebView1, "B4A")
WebView1.LoadUrl("http://www.b4x.com/android/help/jsinterface.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub WebView1_PageFinished (Url As String)
'2 Arguments fail->>> Dim jsStatement As String = "B4A.CallSub('processHTML', document.documentElement.outerHTML)"
Dim jsStatement As String = "B4A.CallSub('processHTML', true, document.documentElement.outerHTML)" '<<<-3 arguments work
myInterface.executeJavascript(WebView1, jsStatement)
End Sub
Sub processHTML(html As String)
Log(html)
End Sub
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim myInterface As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddMenuItem("Save webpage", "SaveWebpage")
Activity.LoadLayout("layoutMain")
myInterface.addJavascriptInterface(WebView1, "B4A")
WebView1.LoadUrl("http://www.b4x.com/android/help/jsinterface.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SaveWebpage_Click
Dim Javascript As String = "B4A.CallSub('processHTML', true, document.documentElement.outerHTML)"
myInterface.executeJavascript(WebView1, Javascript)
End Sub
Sub processHTML(html As String)
Log(html)
End Sub
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim myInterface As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("layoutMain")
myInterface.addJavascriptInterface(WebView1, "B4A")
WebView1.LoadUrl("http://www.b4x.com/android/help/jsinterface.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub WebView1_LongClick (Url As String)
Dim jsStatement As String = "B4A.CallSub('processHTML', true, document.documentElement.outerHTML)"
myInterface.executeJavascript(WebView1, jsStatement)
End Sub
Sub processHTML(html As String)
Log(html)
End Sub
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim myInterface As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddMenuItem("Save webpage", "SaveWebpage")
Activity.LoadLayout("layoutMain")
myInterface.addJavascriptInterface(WebView1, "B4A")
WebView1.LoadUrl("http://www.b4x.com/android/help/jsinterface.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SaveWebpage_Click
Dim Javascript As String
Javascript="B4A.CallSub('processHTML', true, document.documentElement.outerHTML)"
myInterface.executeJavascript(WebView1, Javascript)
End Sub
Sub processHTML(html As String)
Log(html)
End Sub
'Activity module
Sub Process_Globals
End Sub
Sub Globals
Dim myInterface As WebViewExtras
Dim WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.AddMenuItem("Save webpage", "SaveWebpage")
Activity.LoadLayout("layoutMain")
myInterface.addJavascriptInterface(WebView1, "B4A")
WebView1.LoadUrl("http://www.b4x.com/android/help/jsinterface.html")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SaveWebpage_Click
Dim Javascript As String
Javascript="B4A.CallSub('processHTML', true, document.documentElement.outerHTML)"
myInterface.executeJavascript(WebView1, Javascript)
End Sub
Sub processHTML(html As String)
Log(html)
End Sub
Sub WebView1_LongClick '<<<RIGHT
'Sub WebView1_LongClick (Url AsString) <<<<WRONG
Dim jsStatement AsString = "B4A.CallSub('processHTML', true, document.documentElement.outerHTML)"
myInterface.executeJavascript(WebView1, jsStatement)
End Sub