Android Question how to wait for a Service is started ?

peacemaker

Well-Known Member
Licensed User
HI, All

I have already debugged app that works with several Cloud services - now 2.
Each Cloud class module works with corresponding Service module.
And now i need to add 3rd cloud, GoogleDrive (let's say GD).
If to try to make the same way structure - i have to start the GD service were the GD class is declared and all needed subs, events are.

But strange that this 3rd service for GD is starting so slow that i cannot develop in the debug mode.
In Release the service is started fast and it's OK, but ... i need to debug next functions with GD, but Debug mode is ... a trouble now.

Any ideas ?
It seems, i have to wait somehow until the service is started fully...
 

peacemaker

Well-Known Member
Licensed User
But the StartService is called from a common sub of the code module - how to raise an event ?
 

peacemaker

Well-Known Member
Licensed User
It's not Starter, it's special service for GoogleDrive class work. But one service among 3 clouds is started from a code module sub. This sub is single, common for usage in several points, so ... it's usually placed into a code module, right ?
 

DonManfred

Expert
Licensed User
It's not Starter, it's special service for GoogleDrive class work. But one service among 3 clouds is started from a code module sub.
Again: The starter service IS started before any other service or activity!
Define global var in the starter and set the value to TRUE if service x has started. GD service for example change Starter.GDrunning to true when started.
 

peacemaker

Well-Known Member
Licensed User
And how to wait for ... this var is changed ?

B4X:
    Do Until Starter.GD_Service_isStarted
        Sleep(0)
    Loop
?
 

peacemaker

Well-Known Member
Licensed User
Ohhh... Sleep(x) allows next running, so next subs are called, but no service is started yet.
It needs to make fully synchronous ...
 

peacemaker

Well-Known Member
Licensed User
Thanks, but .... the topic question is still open.
And it seems, the only way is use the Starter service as the common start sub container, with Wait for ...Event from the starting service.
 

José J. Aguilar

Well-Known Member
Licensed User
Top