Android Question Network Request at Starter Service

Do you have any sample how to do HTTP job request at the starter service that can be called from an activity? Thank You
 
Do you have any sample how to do HTTP job request at the starter service that can be called from an activity? Thank You
I want to do this because my current solution is I use httpjob request inside an activity to check connection to a server but if I switch to other activity after some time it will return unexpectedly to the activity where I called httpjob. I know that B4Xpages will prevent this but it takes time to convert all the codes to b4xpages
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I know that B4Xpages will prevent this but it takes time to convert all the codes to b4xpages
This is indeed the correct solution.

Do you have any sample how to do HTTP job request at the starter service that can be called from an activity?
Making the http request is simple. Just call a sub that makes the request. I guess that you are having trouble with getting the result, right? This is indeed difficult with non-B4XPages projects. You can use CallSubDelayed to call a sub in the activity, however you should first check whether it is visible with IsPaused(Activity17). Otherwise it will start the activity.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…