Apr 242011
 

Some iPhone apps, such as those that use tilt but not touch, need their screens to stay active.

This might be a very basic concept to those of us who have had to use it before, however many people are unaware that they can control whether or not their/their users’ iPhone or iPad screens will “dim” or move to standby while their application is open.

This mini tutorial is the result of my checking out my analytics data and finding several Corona SDK users have found Techority while searching for answers, so here it is.

To stop your iPhone screen from dimming while your app is running, use this code;

1
system.setIdleTimer(false)

Your screen will no longer dim. To enable it again, set the above to true.

I know this isn’t wildly exciting but I hope it helps some of you.

Peach Pellen :)

Like this post? Subscribe to the monthly newsletter!

 

  17 Responses to “How To Stop Your App From Dimming/Standby”

  1. Ansca forum, I don’t have my own – I spend far too much time on the Ansca ones for that ;)

  2. You have a forum? o.O
    Or might you be referring to the Asnca forums? If so, I guess I’ll register when my internet problems are resolved.

  3. Love the above statement ;D

    Didn’t really know where to put this so I guess I’ll just add it as a comment.
    Your tutorials are much appreciated Peach. My eyes lit up when I saw the sheer number of tutorials here.

    This will be my safe haven for a while. Exactly what I was looking for.

    Once again, Thank you.

    • Thanks very much Rame, I’m glad they’ve been helpful for you. I hope to see you on the forum in the near future :)

  4. So for non-geeks how do you get to a code on an ipad?

    • “Get to a code on an iPad” – are you talking about building an app with CoronaSDK or are you talking about trying to get this code into your iPad totally unrelated to an app? (Just clarifying! You never know with “non-geeks” ;))

  5. Thanks IPete2 – I appreciate your appreciation ;)

  6. Hey Peach,

    you know you’re tech knowledge is well appreciated right!? Thanks for this important little snippet!

    IPete2.

  7. Look at you Nick, helping others out ^-^; Nice :)

  8. Good to know buddy !

  9. @sleepwalker

    Yes it works for android, I have droidX and ipod touch 4g

  10. Hey Bryan, your post didn’t appear until after SleepWalker’s for me, apologies.

    I’m glad I could help you; your post actually prompted me to go look at analytics again and pick a few things out people had found me for but that I didn’t yet have info up about.

    Anyway, glad I could be of service :)

    Peach

  11. I actually can’t say for sure, I’ve never used it on Android – but if you try it in the simulator it will likely tell you whether or not it’s supported. (In iOS it states it’s not supported in the simulator.)

    I’d test but I’ve not got an ARMv7 device.

    If you do, and you try it out, please let me know :)

    Peach

  12. Hi Peach , That code work for Android ?

  13. This was a big issue for me, I found the answer on the forums but I’m glad you mentioned it here!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.