If you don't mind writing a couple lines of javascript, then xdk provides an API for preventing sleep:
https://software.intel.com/en-us/node/493027
In the plugins settings, you have to select the device plugin. It's in the list on the right hand side, under 'featured & custom codova plugins.' There is also a plugin called device on the left hand side, that's not the one you want.
The plugin from cranberrygame will save you some time since you don't have to write the JS. Either way should work.
cranberrygame: I thought Shuher was saying he doesn't want to screen to sleep or dim when there is no input. I found a plugin on github that prevents dimming, but it hasn't been touched for > 1 year so I don't know if it works with latest cordova. I am not sure how many c2 users would want it.
> I might be wrong, but I think this prevents sleep, but not dimming. If you explain what you need then cranberrygame might be able to add that capability.
>
prevent from sleeping is exactly what i need <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">