rolinger
rolinger

Reputation: 3066

cordova method to add app to Androids battery "never auto sleep apps"?

On Android, is there any config.xml or androidManifest.xml setting that allows my app to automatically be added to Androids Battery "never auto sleep apps" section? I can't seem to find any references to this Android setting anywhere.

On Android:

Settings > Battery > Background Usage Limits > Never auto sleeping apps

Is there an equivalent for iOS?

Almost every time my app is moved to the background it restarts upon resume, as if its being opened for the first time. It causes a blank white screen (no typical splash screen) for several seconds and then starts the user at the Home screen (and displays new startup messages) versus where the user left off when they put the app in the background. Its very annoying.

But I found if, as a user, I manually added my app to never auto sleeps apps then my app never restarts. It actually stays in background and reopens cleanly to the same spot the user left off before moving the app to the background.

While my app is in use, which can be anywhere from 30 min to 3 hours, users often put my app to the background to do other tasks and then bring it back to the foreground to continue what they were doing. I can't have my app restarting on them everytime forcing them to navigate to where they were before the forced restart - its a really bad UI experience.

Upvotes: 0

Views: 37

Answers (0)

Related Questions