Ignoring the screen timeout while the app is open

My app requires the screen to be constantly on, and there is no good explanation Samsung has added to the Tizen Developers page. What I tried is:
tizen.power.request ('SCREEN', 'CPU_AWAKE');
But this doesn’t work, should I run this command in body onload? I have no idea :smiley:

If you want it constantly on, use this:
window.onload = function() {
tizen.power.request(‘SCREEN’, ‘SCREEN_NORMAL’);
tizen.power.request(‘CPU’, ‘CPU_AWAKE’);
};

To “stop” it, use this (I recommend you adding this code on the function that will run before/“while” closing the app):
tizen.power.release(‘SCREEN’);
tizen.power.release(‘CPU’);

Both commands require the privilege power to be added to you config.xml file

1 Like