how is StartServiceAt implemented?

schuerstedt

Member
Licensed User
Longtime User
Erel (or someelse you might know),

how is the StartServiceAt function implemented? Could not find the equivalent function in Android yet.

Is there a system database for those scheduled tasks in Android?

Thx

Marcus
 

rfresh

Well-Known Member
Licensed User
Longtime User
I wish there were an easy way to specify starting up a ServiceStartAt on any given minute. Seems you have to do a lot of coding to calculate what specific minute to start up on.
 
Upvote 0

schuerstedt

Member
Licensed User
Longtime User
It uses AlarmManager.

Context.getSystemService(Context.ALARM_SERVICE)

Thx. Found it.

I am wondering, if all those sticky apps on my phone using the AlarmManager to restart themselves? Or is there another way to implement a call which would survive a killing of an app. Because that's excatly what one could create using StartServiceAt.
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
You may get an answer here but you'd have more help possibly in a Java/Android specific forum vs a B4A forum.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Context.getSystemService(Context.ALARM_SERVICE)

Thx. Found it.

I am wondering, if all those sticky apps on my phone using the AlarmManager to restart themselves? Or is there another way to implement a call which would survive a killing of an app. Because that's excatly what one could create using StartServiceAt.

Yes, I think so StartServiceAt is the most robust way for a service to stay alive by scheduling itself into the future or at destruction.
Also, some apps can be listening for other intents to wake them up (for e.g. plugging in a charger or headphone or receipt of an email etc etc).
 
Upvote 0
Top