prevent android device from dimming screen

in main.as
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

in application.xml
<uses-permission android:name="android.permission.WAKE_LOCK"/>