Just back from work and tried changing a few things, but still only the last file gets copied to the phone?
The log error is always false after calling the job.download function?
'Activity module
Sub Process_Globals
Dim SD_PATH As String
Dim imagename As String
SD_PATH = File.DirRootExternal & "/homerbg2/data/"
Dim URL As String
URL = "http://www.homersparadise.com/"
Dim testList As List
End Sub
Sub Globals
Dim bmp As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
testList.Initialize
Dim pics(2) As String
pics(0)="en.png"
pics(1)="bg.png"
testList.add(pics)
'testList.AddAll(testList)
testList.Initialize
For i = 0 To 1
Dim job As HttpJob
imagename = pics(i)
job.Initialize("Job" & i, Me)
job.Download(URL & "images/prop_apps/thumbs/langs/" & imagename)
Log(URL & "images/prop_apps/thumbs/langs/" & imagename & " - " & job.Success)
Next
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Dim out As OutputStream
out = File.OpenOutput(SD_PATH, imagename, False)
File.Copy2(Job.GetInputStream,out)
out.Close
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow(SD_PATH & imagename, True)
End If
Job.Release
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
LOG
Installing file.
PackageAdded: package:anywheresoftware.b4a.samples.httputils2
** Activity (main) Create, isFirst = true **
http://www.homersparadise.com/images/prop_apps/thumbs/langs/en.png - false
http://www.homersparadise.com/images/prop_apps/thumbs/langs/bg.png - false
** Activity (main) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
JobName = Job1, Success = true
JobName = Job0, Success = true
** Service (httputils2service) Destroy **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **