Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
Common.ReadConfig
updater.Initialize(Me,"update") 'tab1 has no meaning; use any name you like
StartService("ScoreEngine")
StartService("CommEngine")
End If
ConfigDB.Initialize(Null)
TmrExpired.Initialize("Expired", 1000)
TmrExpired.Enabled = False
RefreshTimer.Initialize("RefreshTimer", 1500)
RefreshTimer.Enabled = False
SplashTimer.Initialize("SplashTimer", 2500)
SplashTimer.Enabled = False
Updating = False
updater.PackageName = "edge.multisport"
'this is the complete path to the text file holding the newer version number
updater.NewVerTxt = "xxxxx"
'this is the complete path to your newer apk
updater.NewVerApk = "xxxxx"
updater.setCredentials("xxxx", "xxxx")
khYnbJC8dkjXpP9y'RemoveAllViews
Wu4gnrUH'GenerateViews
SplashTimer.Enabled = True
End Sub
Sub SplashTimer_Tick
SplashTimer.Enabled = False
If OnLine = True Then
CheckForUpdates
Else
AGsWJWsj'ContinueBoot
End If
End Sub
Sub CheckForUpdates
Wait For (CheckInstallationRequirements) Complete (Result2 As Boolean) 'This also keeps failing returning false
ProgressDialogShow2("Checking for Updates", False)
updater.ReadCurVN
End Sub
'This subs gets called after each command is executed
Sub update_UpdateComplete
Log($"UpdateComplete - time: ${DateTime.Time(DateTime.Now)}"$)
'too lazy to manage error conditions..check apkupdt.ERR_xxx codes if you like
Select updater.Status
Case updater.OK_CURVER
' Log("Running apk version: " & updater.CurVN)
updater.ReadWebVN
Case updater.OK_WEBVER
' Log("Webserver apk version: " & updater.WebVN)
' Log("Optional Change Log data: " & updater.WebChangeLog)
If updater.CurVN < updater.WebVN Then
Msgbox2Async("There is a newer version available. Do you wish to download?" & CRLF & updater.WebChangeLog, "UPDATE FOUND", "Yes", "", "No", Null, False)
Wait For Msgbox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
ProgressDialogHide
ProgressDialogShow2("Downloading Update, Please Wait.", False)
Wait For (CheckInstallationRequirements) Complete (Result2 As Boolean)
Updating = Result2
updater.UpdateApk(Result2)
Else
AGsWJWsj 'ContinueBoot
End If
Else
AGsWJWsj 'ContinueBoot
End If
Case updater.OK_NEWERAPK
' Log("Newer version available")
Case updater.NO_NEWERAPK
' Log("No newer version available")
AGsWJWsj 'ContinueBoot
Case updater.OK_DOWNLOAD
' Log("Newer version downloaded")
Case updater.OK_INSTALL
' Log("User asked to install newer version")
Case Else
Log("Status: "&updater.Status)
' Msgbox("An error occured during the update process, Please try again later.", "Download Error")
AGsWJWsj 'ContinueBoot
End Select
End Sub