httpimg view problem

roarnold

Active Member
Licensed User
Longtime User
All,

I am coding an app and I need to view png images from a json pull from a php / apache webserver.

When the json data is parsed the http location is in the variable from the json data but when the app finishes it will either display a blank white space or an error.

My partner and I are really :BangHead: and it is frustrating.

httputils are loaded . we have tried urlview and it still giving us fits. The location is loaded into a mysql database and the location is right just nothing comes back and we can't figure out why.

Any thoughts to what we can do in order to get the images on a http location to present properly without having t6o load the images onto the app and do a huge if then else statement on the programming.

BTW we love the B4A programmer. Much Much easier on the old brain versus others that we have used.

Thanks
R.
 

roarnold

Active Member
Licensed User
Longtime User
Code below. Have tried ImageView and WebView in the IDE. Currently have ImageView set for images. It gets parsed but will not display the image. We tried it with hyperlink extension and then just the file. If I hardcode the image in the IDE it works fine.

Thanks,
R


Sub Process_info (info As String)
' Parsing

Dim mapobj As Map
Dim sitems As List
Dim JSON As JSONParser
Dim i As Int
Dim rtext As String
JSON.Initialize(info)
sitems = JSON.NextArray
For i = 0 To sitems.Size - 1
dataholder = sitems.Get(i)
rtext = rtext & dataholder.Get("firstname") & " " & dataholder.Get("lastname") & CRLF & "PO: " & dataholder.Get("PO")



Next

delivery (rtext)

' check for another ticket(s) maresult = "[bla bla bla]" then third activity which will
' present button to retrieve tickets from storeage, need to allow for forward and back through
'

Log(rtext)
If rtext = "" Then
Label1.Text = " PO's Retrieved for Confirmation Code" & Mainr.Confirm & "Thank You"
Return
End If

Return
End Sub
Sub hc_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
' was HttpClient1
Log(Reason)
Log(StatusCode)
ProgressDialogHide
msg = "Error connecting to server."
If Reason <> Null Then msg = msg & CRLF & Reason
ToastMessageShow (msg, True)
End Sub
Sub delivery (rtext)

Dim i, n As Int

Dim images() As ImageView
images = Array As ImageView(ImageView1, ImageView2, ImageView3, ImageView4)
For c = 0 To 3
n = c + 0
images(n).Initialize("images")
Next


Activity.AddView(ImageView1, 0, 0, 530, 270)
Activity.AddView(ImageView2, 0, 40, 80, 80)
Activity.AddView(ImageView3, 450, 40, 80, 80)
Activity.AddView(ImageView4, 160, 130, 190, 40)

rtexttholder = "Ticket Holder: " & dataholder.Get("firstname") & " " & dataholder.Get("lastname")
rtextpo = "PO: " & dataholder.Get("po")
rtextdatetime = "Date/Time: " & dataholder.Get("datetime")
rtextbus = "Business: " & dataholder.Get("bus")
rtextbusimg = dataholder.Get("busimg")

' StringUtils.DecodeBase64




Label1.Text = rtexttholder
Label2.Text = rtextpo
' Label6.Text = rtextskuimage
Label7.Text = rtextdatetime
Label8.Text = rtextbus


Return
End Sub
 
Upvote 0

roarnold

Active Member
Licensed User
Longtime User
Reason

The issue was making the change to transparent and use of canvas. Now I do see that I really don't need canvas but left it for the moment in the code.

Thanks for the help,
R
 
Upvote 0
Top