I am doing a game mainly for Android, but I do not discard porting to other platforms. Developing for min SDK version 8, testing with a Samsung Galaxy S i9003 with Android 3.2. Using cocos2d-x version 2.
My game is using accelerometer in some moments. The problem is that if the player doesn’t touch the screen while playing with the accelerometer, the system goes to sleep and enter background mode. My question is that if cocos2dx provides any mechanism to prevent android go to sleep while using accelerometer.
Another solution is to avoid the entire app entering sleep mode, but I prefer do not avoid it in entire app, I prefer only do it whilst using accelerometer.
Is there any way? Thanks in advance!