Our App is running almost 24/7 connecting to the server.
screen on all the time.
When the user don't do anything in a long time, example, ~60min the App fail connecting to the server, until we reset the App.
When the user is active using the App, all OK
It looks to me Android is pausing process when the Tablet is not used (or screen not touched)
Any way to prevent Android from pausing a process?
The UI Cloud devices are running the "designer" app for many months. The way I do it is by having a small app that restarts the main app when needed. The main app closes itself every several hours and the watchdog app sends an intent that starts the main app every 30 seconds.
Good question. The watchdog has a foreground service. The device itself is never sleeping because the main app keeps the screen turns on.
The watchdog app is small and simple enough to run "forever" without any issues. If there were any issues then the main app can periodically start it with an intent. Nothing happens if the target app is already running.
Good question. The watchdog has a foreground service. The device itself is never sleeping because the main app keeps the screen turns on.
The watchdog app is small and simple enough to run "forever" without any issues. If there were any issues then the main app can periodically start it with an intent. Nothing happens if the target app is already running.