Hi all, I am currently programming an Android app with Xamarin Forms that has a timer and this timer should also work when the display is turned off. After a long research I found out that Xamarin offers two possibilities - foreground service or background service. Disadvantage of background service is that if the system needs more RAM then your app may be turned off or the timer will run slower. Disadvantage of foreground service is that if the system wants to save battery then it can drain resources for your app.
Source: https://proandroiddev.com/android-foreground-service-restrictions-d3baa93b2f70
My question is what is better for a timer: foreground service or background service ?
Is there any other way to run a timer in Xamarin Forms when the display is off?
Thanks to all