0

Is it too much to ask to be able to start an app before I go to bed at night, turn off the screen, and then turn the screen back on in the middle of the night and have it still there, undisturbed? Instead, after 4-5 hours of inactivity there is a good chance that the app will be killed! Why does Android even do this? It can't be for power saving, because the device is plugged in all night (battery charged), and it can't be for speeding up the device because nothing else is running (aside from a few CPU seconds an hour for push notification checks), or for dealing with running out of memory because the device in question has 3GB and almost 600MB is being reported as free. The app is not even in the background, so if the app explicitly foregrounds itself it doesn't really fix the issue.

Even with apps that do a good job of saving their current state and restoring it after being killed (and most do not) it's still a pain because the app is no longer on the screen so it has to be located and started, and then it takes a bit of time for it to for initialization code. During the middle of the night is a very inopportune time to have to do this!

In older versions of Android there were certain hacks you could do to the underlying Linux proc or sys filesystems to try to combat this problem. There is an existing question but it is nearly seven years old. But now I am running the latest version of Android (8.1) and I'm wondering about the current state of the art in solving this problem.

  • It's Doze feature that you want to fight. One way to prevent Doze kicking in is when device is on charge. With fast charging being the common mode now, that's not going to help much. Leave it on charge with a USB 2.0 computer port, that would take time to charge. This is the closet solution – beeshyams Jan 23 '18 at 17:17
  • @beeshyams are you saying that Doze won't kick in when charging, but once charged but still connected to power it will start kicking in? – Michael Jan 23 '18 at 19:56
  • Yes. Connected to power is not same as charging. You can experiment – beeshyams Jan 24 '18 at 1:21
  • That's my understanding of how Doze works – beeshyams Jan 24 '18 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.