This code
Was working fine (not sure when it stopped - just upgraded to 5.8 Monday)
JobDone Never seems to get called
ALL the code works fine in Debug mode but nothing in either Release Modes
BobVal
B4X:
Public Sub Process_Globals
Public gPackageName As String = "com.BOBs.BBS"
End Sub
Public Sub Service_Create
End Sub
Sub Service_Start(StartingIntent As Intent)
SendVersionRequest(gPackageName)
End Sub
Sub Service_Destroy
End Sub
#Region VersionCheck
Private Sub SendVersionRequest(packagename As String)
Dim j As HttpJob
j.Initialize("version_check", Me)
j.Download2("https://play.google.com/store/apps/details", Array As String("id", packagename))
End Sub
Private Sub VersionComplete(s As String)
Dim m As Matcher = Regex.Matcher("softwareVersion\" & QUOTE & ">([^<]+)</div>", s)
If m.Find Then
Dim MainVersion As String = Main.gVersionName
Dim CurrentVersion As String = m.Group(1)
#if Debug
Log("MainVersion[" &MainVersion &"] CurrentVersion[" &CurrentVersion &"]")
#end if
MainVersion = MainVersion.Trim
CurrentVersion = CurrentVersion.Trim
If MainVersion.EqualsIgnoreCase(CurrentVersion) = False Then
CallSubDelayed2(Main, "Version_Check", CurrentVersion)
Else
CallSubDelayed2(Main, "Version_Check", "Versions are Equal")
End If
Else
CallSubDelayed2(Main, "Version_Check", "VersionComplete Find Failed")
End If
End Sub
Private Sub JobDone (Job As HttpJob)
' ToastMessageShow("JobName = " & Job.JobName & ", Success = " & Job.Success, True)
If Job.JobName = "version_check" Then
If Job.Success = True Then
VersionComplete(Job.GetString)
Else
CallSubDelayed2(Main, "Version_Check", "version_check Job.Success Failed")
End If
Else
CallSubDelayed2(Main, "Version_Check", "version_check Failed")
End If
Job.Release
End Sub
#end Region
Was working fine (not sure when it stopped - just upgraded to 5.8 Monday)
JobDone Never seems to get called
ALL the code works fine in Debug mode but nothing in either Release Modes
BobVal