If it is possible to keep an Air for Android application alive during sleep, how can it be done? I know how to prevent sleep and lock but this course is not preferable to some users.
Update
The reason in this case is to keep the video streaming from the phone to a server.
If it is possible to keep an Air for Android application alive during sleep,
Share
I think what you are talking about is preventing Screen Dimming for AIR apps. That is possible using the following:
NativeApplication.nativeapplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE
This overrides the default behaviour and screen never times out until the AIR app is in foreground. To take the mode back to normal you can set the property back to SystemIdleMode.NORMAL. In addition to this code, you will have to specify two permissions in your app.xml for AIR app, which are:
android.permission.WAKE_LOCK
android.permission.DISABLE_KEYGUARD
But as Emmanuel mentioned above, this would definitely mean that your battery will be consumed much faster. However, it could be useful in apps where Video is playing and you don’t want the screen to dim.
Hope this helps.
Mohit