Android Question HttpJob timeout in receiver

naengi

New Member
Hello
I use HTTPJob in the receiver
There is no problem when the program is running and all requests are sent correctly
But

When I close the program, I get a timeout error or Unable to resolve host error šŸ˜‘

What is the problem?

And one more question, is it still possible to run a service in the background on Android 12 and above? Because by using the service, requests are sent without problems

My device: Redmi note 11 pro (android 12)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Unable to resolve host error
This means that the device isn't connected to the internet.

If you are making the request immediately after the device wakes up then it is possible that it wasn't connected yet. You can try to add Sleep(2000) before making the request or make another attempt if it fails.
 
Upvote 0

naengi

New Member
This means that the device isn't connected to the internet.

If you are making the request immediately after the device wakes up then it is possible that it wasn't connected yet. You can try to add Sleep(2000) before making the request or make another attempt if it fails.
Is there any other way than using sleep?
 
Upvote 0
Top