Hi,
i am pretty new here. I want to programm an cinema app. We have a database with all Cinemas and Movies at Germany.
i have a problem to get all Cover images and show then.
First i parse our database with the json paser , that is no problem, but now i need to get the images as well e.g 1.jpg,2.jpg. How can i download the image within the loop and pass them to CreateListItem
Sub JobDone(job As HttpJob)
ProgressDialogHide
If job.Success Then
Dim res As String
res = job.GetString
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select job.JobName
Case "Job1"
Dim COUNTRIES As List
COUNTRIES = parser.NextArray 'returns a list with maps
clv3.Initialize(Me, "clv3")
Activity.AddView(clv3.AsView, 0, 0, 100%x, 100%y)
For i = 0 To COUNTRIES.Size - 1
Dim m As Map
m = COUNTRIES.Get(i)
'We are using a custom type named TwoLines (declared in Sub Globals).
'It allows us to later get the two values when the user presses on an item.
Dim tl As TwoLines
tl.First = m.Get("titel")
tl.Second = m.Get("darsteller")
tl.Third = m.Get("genre")
tl.Lid = m.Get("id")
Dim Cover As String
clv3.Add(CreateListItem("Titel : " & tl.First & CRLF & CRLF & "Darsteller : " & tl.Second & CRLF & CRLF & "Genre : "& tl.Third , clv3.AsView.Width, 150dip , res2), 150dip, "Item #" & i)
Next
End Select
End If
job.Release
End Sub
regrads Christian
i am pretty new here. I want to programm an cinema app. We have a database with all Cinemas and Movies at Germany.
i have a problem to get all Cover images and show then.
First i parse our database with the json paser , that is no problem, but now i need to get the images as well e.g 1.jpg,2.jpg. How can i download the image within the loop and pass them to CreateListItem
Sub JobDone(job As HttpJob)
ProgressDialogHide
If job.Success Then
Dim res As String
res = job.GetString
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select job.JobName
Case "Job1"
Dim COUNTRIES As List
COUNTRIES = parser.NextArray 'returns a list with maps
clv3.Initialize(Me, "clv3")
Activity.AddView(clv3.AsView, 0, 0, 100%x, 100%y)
For i = 0 To COUNTRIES.Size - 1
Dim m As Map
m = COUNTRIES.Get(i)
'We are using a custom type named TwoLines (declared in Sub Globals).
'It allows us to later get the two values when the user presses on an item.
Dim tl As TwoLines
tl.First = m.Get("titel")
tl.Second = m.Get("darsteller")
tl.Third = m.Get("genre")
tl.Lid = m.Get("id")
Dim Cover As String
clv3.Add(CreateListItem("Titel : " & tl.First & CRLF & CRLF & "Darsteller : " & tl.Second & CRLF & CRLF & "Genre : "& tl.Third , clv3.AsView.Width, 150dip , res2), 150dip, "Item #" & i)
Next
End Select
End If
job.Release
End Sub
regrads Christian