Sub Button1_Click
ProgressDialogShow2("Loading .......",False)
Dim job1 As HttpJob
job1.Initialize("Job1", Me)
job1.Download("")
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
Select Job.JobName
Case "Job1"
ToastMessageShow("Download Complete", True)
Dim out As OutputStream = File.OpenOutput(File.DirInternal, "AppUpdateExample.apk", True)
File.Copy2(Job.GetInputStream, out)
' ToastMessageShow("تم تحميل الملف بنجاح",True)
out.Close
ProgressDialogHide
Dim i As Intent
i.Initialize(i.ACTION_VIEW,"file://" & File.Combine(File.DirInternal, "AppUpdateExample.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