Hello,
I wanted to ask if I can help those who may have already looked at HTTP examples, but does not continue anyway. Perhaps a solution-oriented whoever. Here is my code, what does not. : (
here is some code I have been working on, in the link below this is only part of the code.
'dim stuff
B4X:
Dim hcimage As HttpClient 'download the image
Dim reqimage As HttpRequest
get the image - pic being image name
B4X:
Dim imagepath As String
imagepath = "http://m.metservice.com/sites/all/themes/mobile/images/wx-icons/"& pic
reqimage.InitializeGet(imagepath)
hcimage.Execute(reqimage, 1)
save it
B4X:
Sub hcimage_ResponseSuccess(Response As HttpResponse, TaskId As Int)
Response.GetAsynchronously("ImageResponse", _
File.OpenOutput(File.DirInternalCache, pic, False), True, TaskId)
End Sub
'load image auto
B4X:
Sub ImageResponse_StreamFinish (Success As Boolean, TaskId As Int)
If Success = False Then
Msgbox(LastException.Message, "Error")
Return
End If
imgtemp.Bitmap = LoadBitmap(File.DirInternalCache, pic)
End Sub
'load the image manually
B4X:
If File.Exists(File.DirInternalCache, pic) Then
'if so then load it
imgtemp.Bitmap = LoadBitmap(File.DirInternalCache, pic)