Pedro Caldeira Active Member Licensed User Longtime User Apr 19, 2022 #1 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 Code: Copy Service.StopAutomaticForeground StartServiceAtExact (Me, DateTime.Now + 10 * 1000, True) ' 30 seconds Best Regards, Pedro Caldeira
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 Code: Copy Service.StopAutomaticForeground StartServiceAtExact (Me, DateTime.Now + 10 * 1000, True) ' 30 seconds Best Regards, Pedro Caldeira
DonManfred Expert Licensed User Longtime User Apr 19, 2022 #2 Pedro Caldeira said: If there any know limitation in Android for the recurrence of a service ? Click to expand... 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
Pedro Caldeira said: If there any know limitation in Android for the recurrence of a service ? Click to expand... 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.
Pedro Caldeira Active Member Licensed User Longtime User Apr 19, 2022 #3 You mean, I have to use Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_ALWAYS ? Upvote 0