Prevent screen from going to sleep

How to prevent mobile device (Android or iOS) to put screen to sleep?
I'm using Flash CS6 + AIR, in publish settings under Permissions I do have these two marked: DISABLE_KEYGUARD and WAKE_LOCK. But I don't see it working, i'm testing on Samsung Galaxy S3 (latest Android OS).
Although it says it only needs to be in XML file those two lines, don't I have to put anything in ActionScript 3.0 code inside my Flash document ?
When I pack APK file is XML also packed there ?
Thanks

These functions will give you an idea of what you have to do on the AS3 side:
import flash.desktop.NativeApplication;
import flash.desktop.SystemIdleMode;
stage.addEventListener(Event.ACTIVATE, fl_Activate);
stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);
private function fl_Activate(event:Event=null):void {
     NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
private function fl_Deactivate(event:Event):void {
     NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.NORMAL;
The XML, where you have set the wake lock permissions for Android, does end up in the APK.

Similar Messages

  • Youtube videos prevent computer from going to sleep. any way to fix this?

    even if they aren't actually playing anymore, even if they are paused, even if they are in a background tab or window.
    I hate this. is there ANY way to fix this?
    i tried this in camino, safari 2.

    I don't believe i am the only person in the world who has discoved the youtubes, and yet still wanted their computer to go to sleep automatically.
    I tried this on 5 other computers, and the results are always the same.
    YOUTUBE VIDEOS PREVENT YOUR MAC FROM AUTOMATICALLY GOING TO SLEEP.
    tell me im wrong, tell me theres a fix, tell me aything. just talk to me! for the love of god!

  • Browsers prevent machine from going to sleep?

    Is this normal? For some reason I remember my machine auto-sleeping while programs were running - and now the screen turns off but I can still hear the machine running. If I quit the browsers (both Firefox & Safari) it goes to sleep normally.
    What's the deal?

    Well - presumably, you have found, reviewed, assessed, and tried all the most relevant of Dale's Tips
    http://discussions.apple.com/message.jspa?messageID=2777927#2777927
    If it was just browsers causing the insomnia it might have been a problem with the network - anyway, still thinking...

  • Preventing computer from going to sleep

    Our main production software (IQue 5.5) is screwed up if the computer goes to sleep.  We put in an order for 10 mac minis running mavericks and then the new mini got announced the very next day and there is no stock left on the old machines and we were forced to try it with yosemite.  We got one system and set it up on one guinea pig, and so far the only real problem is that yosemite no longer has an option to set system sleep to "never" and it keeps sleeping at random points while the user is working and kicks him out of IQue.
    Is there some way that we can get the (new dual-core i7 at 3.0GHZ) mac mini to never sleep?

    For what it's worth, I've had that hpdot4d process showing up ever since I set up my HP officejet 5610 on my Mac, and I'm still running 10.4. I'm pretty sure this is an HP problem, not an Apple problem...
    --John

  • Prevent Mac from going to sleep

    Hy guys!
    Yes, I know that there are a lot of programs, like Caffeine or Slepless ecc..
    But the program I'm looking for should avoid sleep _even under my command_
    (.. because sometimes my dad doesn't realize that my Ipod is charging, or I'm importing photos or downloading files..)
    Thank you v.m. =)

    Maybe I didn't make myself clear... If I follow your way, everytime I click on the "sleep" button, my mac goes obviously to sleep... That's exactly the thing I want to avoid... =))
    Thank you!

  • I use my iPad Mini for giving speeches.  Is there any way to keep the screen from going to sleep?

    I should say, when I pause while someone else talks for a couple of minutes.

    http://ipad.about.com/od/ipad_basics/ss/How-To-Delay-The-Auto-Sleep-Mode-On-The- iPad.htm
     Cheers, Tom

  • OneNote prevents my computer from going to sleep when I have a shared notebook open. Suggestions?

    Hello,
    The issue is that my computer will not go to sleep if I have OneNote opened with my shared notebook loaded.
    Background: I'm currently running Windows 8 Pro on a desktop machine with Office 2010 Home and Student installed. I log into the OS under my outlook.com internet account.  OneNote, which I always keep open, has my main
    notebook shared on my SkyDrive.
    Scenarios: The computer will go to sleep if I reboot the machine and do not open OneNote. The computer will go to sleep if I close my shared notebook, reboot the machine and open OneNote (with no notebooks open). The computer will go to sleep if I open
    OneNote with my shared notebook, close it, AND exit OneNote from the icon in the system tray.
    The scenarios I ran lead me to believe that OneNote is continuously polling my shared online notebook, thus preventing my computer from going to sleep. The is a regression from the behavior in Windows 7. Are there any configuration changes I can make to
    fix this?
    Thanks.

    Try modify the settings under:
    Control Panel --> Power Options --> Multimedia settings --> When sharing media to Allow the computer to sleep
    Max Meng
    TechNet Community Support
    A new Office has arrived, try it now.
    A beautiful Start. It begins here. Windows 8 and Windows RT.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Preventing iPod touch screen from going blank when iPod's powered.

    Hi there, is there anyway (or app) to prevent the iPod touch's screen from going blank/turning off?
    This is why I ask...
    I often use my iPod touch as my remote, where I choose which of my iMac's iTunes songs to play next and besides I'm always revising/updating the songs' ratings.  My iPod has a password to unlock and so, doing what I just said often can be bothersome.  I've found out that, if the iPod's own music is playing when connected to the power, the screen never goes blank, it only dims, which is very helpful but, since I'm not listening to the iPod, I always have to turn the iPod's volume all the way down.  Also this increments the number of plays to all those songs played back which is something I don't like either and so, again my question is, does anybody know if there is any way or app that, when the iPod's connected to power, only dimmed the screen (but not allow it to go blank)?
    Hope you can help.
    Thanks.
    Jorge...

    Go to Settings>General>Auto-Lock and set time to never.  If you have a corporate exchange mail account on the iPod that may prevent using never (Never not present).

  • How do I keep my iPhone or ipad from going to sleep while using airplay to my Apple TV ?, How do I keep my iPhone or ipad from going to sleep while using airplay to my Apple TV ?

    With airplay on, how to keep ipad from going to sleep? Same with my iPhone, with airplay steaming to my Apple TV, the phone or ipad will go to sleep. Settings?
    Advice welcome.
    Thank you for your time, Eric

    Yes, that is happening because of the app. Not all apps behave this way. For example, if you use the youTube app with AirPlay the screen will turn off but AirPlay continues. If you use the Netflix app the screen will not turn off and, of course, AirPlay continues.
    The best course with the NCAA app would appear to be to supply power to the iPad and set Autolock to never. Turn the iPad screen intensity down.

  • How to stop the macbook from going to sleep

    How do you stop my macbook from going to sleep when you close the screen? Like when you want to just move it around but do not want it to sign off or anything. Thanks guys

    Well I just spent the past hour restoring my system after installing ismonia. I shut the lid and then reopened it. All was great, then the laptop wouldn't shut down. I tried to fix the disk with Disk Utility but it shut down on its own. It wouldn't startup.
    If you try it make sure you have a recent backup.

  • How can I stop my screen from going on and off when I play games ?

    HOw can I stop my screen from going on and off all the time when I touch it.

    Maybe it is a hardware problem, but you will not know that unless you start eliminating all possible software issues. Try this. Close all apps in the recents tray and reboot your iPad.
    Tap the home button once. Then tap the home button twice and the recents tray will appear at the bottom of the screen. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button twice.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • How do i keep my ipad from going to sleep during presentations

    I'm using Evernote for notes during a presentation. How do I keep the iPad from going to sleep so I can read my notes?

    Bey you have have an MS Exchange account on the iPad (through your work) and they are limiting the options you have (disabling 1, 3, 4 & Never).
    Try this...
    Settings > Mail, Contacts, Calendars.
    Select the Exchange account then set it Off.
    Go to Settings > General > Auto-Lock and you should see all options.
    Set it to what you want.
    Then turn on the Exchange account.
    The Auto-Lock settings should stay.
    However, if you go back and view the Auto-Lock settings, it will change back toonly  2 and 5.

  • How to prevent screen from dimming/sleeping/etc when playing video?

    When playing a video, how do you keep your monitor from dimming or sleeping, or turning the screen saver on in the middle of your video?
    In Linux, using mplayer on X11, whenever a video would play, it would "disable DPMS" and the screen would stay on until the video was finished playing, just as if someone was in the middle of typing.
    Is there a setting for this with the MacBook? I suppose it would have to be something global, meaning for QuickTime player, embedded WMV browser players, etc.
    MacBook   Mac OS X (10.4.6)  

    I only want to make changes for sleep and screen saver activation times for when I'm playing videos. I mean, if I'm watching an hour long video, I want to watch it without the screen changing 10 minutes into it.
    However, I don't want to set my screen saver at 1 hour globally, as when I walk away from my text editor, it should sleep after 10 minutes or so.
    Isn't there a way to set something so that the sleep/screen saver settings are disabled just when a video is being played?

  • My Screen Keeps Going to Sleep after restore from Time Capsule

    This is the weirdest thing. I've had a new had drive put in, so I restored the system from Time Capsule. Now for some weird reason the display keeps going to sleep. I can bring it back up with ctrl-shift-eject, but two seconds later it goes back off.
    I've since migrated to Snow, hoping that this would fix the problem, but nada.
    Aaarg!!!!!
    Message was edited by: macfuente

    I've reset SMC as well - it's still doing it randomly

  • How do I keep the music screen on after nano "wakes" from going to sleep?

    When I'm playing music and my 7 gen nano goes to sleep, it'll awake to the home screen, not the music screen it went to sleep with. This is really annoying, especially when I'm on a walk or something. I tested my friend's identical iPod and hers stays on the music screen when it wakes. Any solutions? Thank you.

    I have the same problem (deleted email account). I think I mistakenly set up an account when I was buying an Apple product online, not realizing that it would be the same ID as my iTunes.
    What is the way to actually contact Apple?
    I have been clicking around in circles for hours! Will I have to pay them to resolve this? I don't have any products still have applecare . . .

Maybe you are looking for