How to keep application awake?

28 views
Skip to first unread message

mrunhappy008

unread,
Aug 15, 2014, 8:30:09 PM8/15/14
to codenameone...@googlegroups.com
Is there an example somewhere for the CodenameOne how to keep an application awake (eventually running in background) or this needs to be done by a native code? The problem which I'm experiencing is when the screen goes off, the application goes sleep as well for a while, it periodically wakes up, for example the application should once in a minute give a tone (signal), this part is working fine when the screen is on, but when the screen goes off, the tone is executed about every ten minutes.
Thank you in advance for any help.
Rafał Jackiewicz

Shai Almog

unread,
Aug 16, 2014, 3:43:48 AM8/16/14
to codenameone...@googlegroups.com
Background is problematic e.g. iOS doesn't really support background execution in the sense that Android supports it.
If you want to disable the screensaver you can do so with: Display.getInstance().isScreenSaverDisableSupported() and Display.getInstance().setScreenSaverEnabled(false);
Reply all
Reply to author
Forward
0 new messages