Download2 syntax array

m643

Member
Licensed User
Longtime User
Hi all,

I don't understand exactly how I can read the array values in the jobdone.

In a loop I pass the image link and the array values like this
B4X:
Dim ImageJob As HttpJob
ImageJob.Initialize("ImageJob", Me)
ImageJob.Download2(m.Get("thumbnail"), Array As String(m.Get("title"), m.Get("id")))

For example I want to display the m.Get("title") in a msgbox in the jobdone? How can I do that because msgbox(m.Get("title"),m.Get("title")) isn't working.

Thanks
 

m643

Member
Licensed User
Longtime User
This map is filled by an ExecuteRemoteQuery.

B4X:
Sub JobDone(Job As HttpJob)
   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 SP_LIST
            Dim LIST1 As List      
            LIST1 = parser.NextArray 'returns a list with maps
            For i = 0 To LIST1 .Size - 1
               Dim m As Map
               m = LIST1 .Get(i)
                                        Dim ImageJob As HttpJob
                                        ImageJob.Initialize("ImageJob", Me)
                                        ImageJob.Download2(m.Get("thumbnail"),Array As String(m.Get("title"), m.Get("id")))
 
Upvote 0

m643

Member
Licensed User
Longtime User
Hi Erel,

Thank you for your reply.
Can you give me an example how to add a tag field of type object. Sorry i'm a beginner and I don't know what you exactly mean.
 
Last edited:
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
This map is filled by an ExecuteRemoteQuery.

B4X:
Sub JobDone(Job As HttpJob)
   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 SP_LIST
            Dim LIST1 As List     
            LIST1 = parser.NextArray 'returns a list with maps
            For i = 0 To LIST1 .Size - 1
               Dim m As Map
               m = LIST1 .Get(i)
                                        Dim ImageJob As HttpJob
                                        ImageJob.Initialize("ImageJob", Me)
                                        ImageJob.Download2(m.Get("thumbnail"),Array As String(m.Get("title"), m.Get("id")))
great simple array to do for ur image or mp3 music ?
 
Upvote 0
Top