Sub upgrade
upgradeari.Initialize("upgradeari", Me)
upgradeari.Download("http://www.mysite.com/upgrade/myapp.apk")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "upgradeari"
'print the result to the logs
Log(Job.GetString)
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirInternalCache, "myapp.apk"))
i.SetType("application/vnd.android.package-archive")
StartActivity(i)
End Select
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub