[Android] Keep application running when device go to sleep
-
Hi,
is there a way to keep application running while device go to sleep?
Thanks in advance
-
I don't think so. If a device goes into sleep mode, only some kernel parts will not sleep. If any other app will be able to run in sleep mode, what meaning will a sleep mode have?
-
So another question, is there a way to prevent device from going into sleep mode, while application is running?
-
Yes. But i don't know the Qt possibilities in this case.
http://developer.android.com/reference/android/os/PowerManager.html
Take a look at WakeLock...
-
HI, actually you can force device screen to stay active while your app is running. You need to modify QtActivity like it's done "here.":http://sourceforge.net/p/erebusrpg/code/ci/master/tree/android/src/org/kde/necessitas/origo/QtActivity.java#l592 (direct link to your problem solution)
This link is to some opensource Qt based game that runs also on android. It's called Erebus RPG. You can find some really usefull stuf there like integrating c++ with java in order to handle Activity states etc. Look at "main.cpp":http://sourceforge.net/p/erebusrpg/code/ci/master/tree/