The first thing the app does is check for program updates then validates device credentials via a web backend. I can reproduce the HTTP hang consistently if I restart the tablet and then immediately launch the app. I added a variation of the code @OliverA posted as follows:
Initialize HTTP:
' Wait to be sure HTTP service is up and running
' https://www.b4x.com/android/forum/threads/sending-m-to-waiting-queue-of-uninitialized-activity-submitjob.149674/post-949001
StartReceiver(HttpUtils2Service)
Dim piCount As Int = 0
Do While HttpUtils2Service.TempFolder = ""
piCount = piCount + 1
lblInfo.Text = "Waiting for local WiFi connection (x" & piCount & ")..."
Sleep(4000)
Loop
This waits for up to 80 seconds sometimes upon startup. Once the app has been ran once you never see it displayed.
What caused the issue for me was the HTTP job never timed out and it never produced a response either (thereby hanging the app). I initially got around this by adding my own internal timeouts to handle things. By adding the above code you can see a delay waiting for the service, then once that loop completes the app behaves as normal.
My question is: should this be the new design model or is there something that can be done with the HttpUtils2Service to mitigate this issue?
Hi, after a long thread and a lot of testing, we came to the conclusion that when running this: StartReceiver(HttpUtils2Service) Depending on the device it may start instantly, or I may start in a few seconds, or it may start in minutes, or it may never start. This is a problem because in the...
Hi, after a long thread and a lot of testing, we came to the conclusion that when running this: StartReceiver(HttpUtils2Service) Depending on the device it may start instantly, or I may start in a few seconds, or it may start in minutes, or it may never start. This is a problem because in the...