Sub Activity_Create(FirstTime As Boolean)
SendVersionRequest("anywheresoftware.b4a.b4abridge")
End Sub
Sub SendVersionRequest(packagename As String)
Dim j As HttpJob
j.Initialize("version", Me)
j.Download2("https://play.google.com/store/apps/details", Array As String("id", packagename))
End Sub
Sub VersionComplete(s As String)
Dim m As Matcher
m = Regex.Matcher("softwareVersion\" & QUOTE & ">([^<]+)</dd>", s)
If m.Find Then
Log("version = " & m.Group(1)) 'VERSION FOUND
Else
Log("version not found")
End If
End Sub
Sub JobDone (Job As HttpJob)
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success = True Then
If Job.JobName = "version" Then
VersionComplete(Job.GetString)
End If
Else
Log("Error: " & Job.ErrorMessage)
ToastMessageShow("Error: " & Job.ErrorMessage, True)
End If
Job.Release
End Sub