Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("test_first")
try:
image_view_1.Bitmap = LoadBitmap(File.DirRootExternal,"image.jpeg")
catch:
Log("There was a problem with the bitmap finding")
End try
job3.Download2("http://www.novasoftware.se/ImgGen/schedulegenerator.aspx?format=png&schoolid=52550/sv-se&type=1&id=aaaaaC9FBD960-702E-4549-8889-827B5A1EDB85aaaaaa&period=&week=46&mode=0&printer=0&colors=32&head=0&clock=0&foot=0&day=0&width=1883&height=887&maxwidth=1883&maxheight=887",Array As String("aaaaa","[","aaaaaa","]"))
End sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1", "Job2"
'print the result to the logs
Log(Job.GetString)
Case "Job3"
'show the downloaded image
Msgbox("Pic downloaded","")
Dim outputstream1 As OutputStream
Dim photo As Bitmap
photo.Initialize3(Job.GetBitmap())
'outputstream1.InitializeToBytesArray(1000)
'photo.WriteToStream(outputstream1,10,"JPEG")
Dim Out As OutputStream = File.OpenOutput(File.DirRootExternal, "image.jpeg", False)
photo.WriteToStream(out, 90, "JPEG")
out.Close
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub