Prevent screen to turn off

Prevent screen to turn off
0.0 0


I have a game that uses accelerometer to play.
But the screen turn off after a time, there a way to do that not happen?
I develop for ios, android and blackberry, there’s a solution that works multiplataform or I need to do that for each plataform specifically?

Any help will be appreciated.


Hi Fabio (Yes i’m da guy who asked about airpush :)) i am facing the same problem now in my game. I am using accelerometer too and the device goes to sleep.

so did you found any way to do it in cocos2dx or do we have to do it on each platform separately?


I did it in android plataform.

Take a look in my blog post

Modify the activity java class in your android project.