I just found a problem with the Job.Success. Sometimes my applications try to connect to some page via HttpJob, but in some cases there is no internet connection, and the result is an alien page of the Router Reporting the connection services of the hotel or a Vodafone router or another company informing that there is no Internet conection.
In these cases enter JOBDONE with Job.Succes = true, and then run the code as if browsing the web.
I can a check look for a string to verify is are inside my page, but the problem is when I have to use JSON to receive this information.
I use this code, and it works for me, but I would like to know if someone has solved this problem in a better way.
Thanks
In these cases enter JOBDONE with Job.Succes = true, and then run the code as if browsing the web.
I can a check look for a string to verify is are inside my page, but the problem is when I have to use JSON to receive this information.
I use this code, and it works for me, but I would like to know if someone has solved this problem in a better way.
Thanks
B4X:
Sub JobDone(job As HttpJob)
Log("jobdone")
If job.Success Then
Dim res As String = job.GetString
Try
Dim parser As JSONParser
parser.Initialize(res)
Dim ListOfFiles As List
ListOfFiles.Initialize
ListOfFiles.Clear
ListOfFiles = parser.NextArray
ListOfFiles.Sort(True)
Catch
Log("main_jobdone_trycatch: " & LastException)
job.Release
Return
End Try