Currently, I have programmed a regular Andorid application (no service). It contains a timer for periodic checks. To avoid problems with the service and the connection between the Service and the Application, I ask myself if there is a way to save an application that is no longer in the foreground. Currently, when I โcloseโ the application, it is still alive until the Android OS decides to kill it. Is there any way to avoid this killing - for example, by a specific command in "onDestroy" or a specific App flag? My application is quite complicated, and I do not want to implement a Service like this, especially communication / binding - it increases complexity. Is there a "easy way", or am I really forced to use Service + App? Maybe there is a trick to register an application for sth. A feature that has a side effect is that the Android OS does not kill it when it is in the background.
Edit for a better understanding: itโs normal that the GUI can go into the background (disappear) when the user wants it, so my question is not to allow the graphical interface of my application to be constantly in the foreground. All I want is that the timer remains intact without the need for additional service.
Thanks everyone for the ideas in advance!
source share