Sub Process_Globals
Dim url_source As String
Dim file_name As String
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim job1 As HttpJob
job1.Initialize("Job"&file_name, Me)
job1.Tag = file_name
job1.Download(url_source)
End Sub
Sub Service_Destroy
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success = True Then
Dim out As OutputStream
out = File.OpenOutput(File.DirDefaultExternal, Job.Tag, True)
File.Copy2(Job.GetInputStream,out)
out.Close
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub