Sub Globals
Dim ftpa As FTP_Auto
End Sub
Sub Activity_Create (FirstTime As Boolean)
Activity.LoadLayout("download_prog")
Dim names(1) As String
names(0) = "mein.programm.apk"
Try
ftpa.Initialize(Activity, Me, "ftp_server", "ftp_username", "ftp_passwort", 21, False, True)
ftpa.SetCompletedDownloadDialog(True, "Download abgeschlossen")
ftpa.SetProcessCompleteOn(True)
ftpa.SetText("Programmdownload", "Programmupload", "Datei", "Fortschritt", "Abbrechen", "Fertig")
ftpa.DownloadFileSet(File.DirDefaultExternal, names, False)
Catch
Msgbox("Fehler beim Download des Programmupdates!", "programm_name")
Activity.Finish
Return
End Try
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If ftpa.IsInitialized Then ftpa.CloseNow
End Sub
Sub FTP_ProcessComplete
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirDefaultExternal, "mein.programm.apk"))
i.SetType("application/vnd.android.package-archive")
StartActivity(i)
Activity.Finish
End Sub