Hi, I was converting an old project that invoked a webservice and through the property HttpUtils2Service.progressSub = "DownloadProgress" and the
B4X:
Sub DownloadProgress (tmp As ProgressStatus)
ProgressDialogHide
If ProgressBar1.Visible = False Then
lblDownload.Visible = True
ProgressBar1.Visible = True
End If
ProgressBar1.progress = Round ((tmp.downloaded * 100) /tmp.total)
End Sub
I could see the progress of the download. Unfortunately this property is no longer present in the new libraries. How can I progress after a PostString call?
Type DownloadData (url As String, Target As Object, EventName As String, PostString As String)
Public Sub StartDownload(data As DownloadData)
If jobs.ContainsKey(data.url) Then
Log("Ignoring duplicate request.")
Return
End If
Dim J As HttpJob
J.Initialize(data.url, Me)
Dim tag As JobTag
tag.Initialize
tag.data = data
J.tag = tag
jobs.Put(data.url, J)
J.PostString(data.url,data.PostString)
If timer1.Enabled = False Then StartTimer(data.Target)
End Sub