Languages

Menu
Sites
Language
isScreenOn() in Tizen

I want to use Power APi and its function isScreenOn();  I add Power api in config.xml file from internet and in js file i tried to access that api so when i reach to tizen.power. then after "." it show me only two function of power class that are release and request. But it doesn't show isScreenOn and other function too. I have Tizen SDK version 2.0.0a. Any help would be appriciated

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

6 Replies
Vineet Tiwari
function onScreenStateChanged(previousState, changedState) { console.log("Screen state changed from" + previousState + "to" + changedState); } tizen.power.setScreenStateChangeListener(onScreenStateChanged); You could use this instead
Vineet Tiwari
No need to add any power api in config file , my sample app on power worked fine . It showed boolean value whether the power is on or not
Vineet Tiwari
var isScreenOn = tizen.power.isScreenOn(); console.log("status----"+isScreenOn); add this to your main.js inside init and run
Noureen Akhter
Actually i did the same but i got error in console: Undefined Object on line on which i used this function var isScreenOn = tizen.power.isScreenOn(); console.log("status----"+isScreenOn); and interesting thing is that if i write tizen.power and press Crtl+Space for available function it did not show me isScreenOn() function. And one thing more is that Sample app Power is not working on tizen test device if i press for Dim Screen Display it won't work and same problem with rest buttons. And if i not include tizen/power api it doesn't give me tizen/power api. One thing more that Sample app Power also include tizen/power api in config class. All work is done on Tizen SDK version 2.0.0a
Vineet Tiwari
I'm working on 2.1 SDK , so maybe i'm not getting that problem . will get back to you soon
Vineet Tiwari
http://s1347.photobucket.com/user/swathi50391/media/IMAG0993_zpse31d8244.jpg.html now i've tried it in 2.0 SDK ,worked fine for me when i clicked on ctrl+space . take a look at the screenshot