Android Question Service schedule in seconds

Pedro Caldeira

Active Member
Licensed User
Longtime User
Hello All,
I have an APP with several activities, modules, classes and services.
Some of my services run at small intervals, seconds aparts. If there any know limitation in Android for the recurrence of a service ?
I have noticed that some services at given time stop and do not restart.
I am using for example in the Sub Service_Start, the following code to schedule the service

B4X:
Service.StopAutomaticForeground
StartServiceAtExact (Me, DateTime.Now + 10 * 1000, True) ' 30 seconds


Best Regards,

Pedro Caldeira
 

DonManfred

Expert
Licensed User
Longtime User
If there any know limitation in Android for the recurrence of a service ?
The time between two runs should be more than at least 30 Minutes/1 Hour. Android does not allow it faster.
If you need it faster. Use a foregroundservice. Here you can run things in 10 second intervals.
 
Upvote 0
Top