I've been struging since yesterday on how to do a "simple" task, that is to retrieve a WebPage's html source-code... From what I can see, with WebView its just not possible, so I should use http instead, but albeit all my efforts, no luck...
Hi,
If it is the HTML code that you require directly off a web site then at its most basic if you use the following code from Erel's HttpUtils example,
B4X:
Sub Globals
Dim b4a As String
b4a = "http://www.b4x.com"
End Sub
Sub Activity_Create (FirstTime As Boolean)
HttpUtils.CallbackActivity = "Main" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.Download("Job1", b4a)
End Sub
Sub JobDone (Job As String)
Dim s As String
If HttpUtils.IsSuccess(b4a) Then
s = HttpUtils.GetString(b4a)
End If
End Sub
what ever site address you set in the string "b4a" will be returned to the JobDone Sub when the site is fully loaded (not to a webview), the string "s" will contain the actual HTML code. Then you can parse this any way you want. I use this technique quite a bit to strip data from a web page and display it in a more easy to read fashion on a device. You can modify this string and then load it to a webview with