Foreground app killed by OS after ~ 1 hour in standby mode
I have an application where the user is requested to sign in and then presented with an activity. A service is also started on the sign in which uses the location manager to track his current location. everything works perfectly until the application is left in standby mode (screen off an app in background for more than ~ 1 hour) how can I prevent this? as I understand, if I have a foreground service running, the OS should not kill the app.. so what am I doing wrong? the OS I am testing on is Oreo starting the service on sign in: startService(intent); the service: public int onStartCommand