Hi,
is there a way to use HttpUtil synchronous ? In my app I parse a downloaded XML file:
after parsing the XML I need to download the ICONS list and put the PNG to the associated name etc. - but that failed obviously due to the async
any ideas?
THX
M
is there a way to use HttpUtil synchronous ? In my app I parse a downloaded XML file:
B4X:
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("channel") > -1 Then
If Name = "name" Then
Title = Text.ToString
titles.add(Title)
Log(Title)
Else If Name = "address" Then
Link = Text.ToString
links.Add(Link)
Log(Link)
Else If Name = "type" Then
ctype = Text.ToString
ctypes.Add(ctype)
Log(ctype)
Else If Name = "iconUrl" Then
icon = Text.ToString ' not used
If icon="" Then
icon = "http://192.168.252.255/dummy.png"
End If
Log(icon)
icons.Add(icon)
icon=""
End If
End If
end sub
B4X:
Sub ImageUrlDone (Url As String)
If HttpUtils.IsSuccess(Url) Then
bitmaps.Add(HttpUtils.GetBitmap(Url))
Log("ImageUrlDone" & Url)
HttpUtils.SuccessfulUrls.Remove(Url)
End If
End Sub
Sub ImagesJobDone
For i = 0 To links.Size-1' HttpUtils.SuccessfulUrls.Size - 1
lv.AddTwoLinesAndBitmap(titles.Get(i), links.Get(i),bitmaps.Get(i))
Log(titles.Get(i) & links.Get(i)& bitmaps.Get(i))
Next
End Sub
any ideas?
THX
M