air for mobile device keep awake

2013年4月23日 星期二 by Hu, Ching-Hsiang

it’s very easy to make the device stay awake. First you need to enable the following two permissions in the -app.xml file:

<uses-permission android:name="android.permission.WAKE_LOCK">
<uses-permission android:name="android.permission.DISABLE_KEYGUARD">
</uses-permission></uses-permission>



Then you need to use this simple line of code anytime you want to keep the device awake: NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE; To enable the device to go to sleep again: NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;

Filed under having  

0 意見: