Is it possible to disable Screen timeout only when a particular program is running?

If so, how do I do that?

My Nexus One has a "Screen timeout" in "Display settings" that lets me choose anywhere between 15 seconds and 30 minutes, but this is across the board. I would like it to disable screen timeout only when one of the programs (that I currently develop) is running. Is this possible?

If this isn't possible, is it possible to disable it for only when a program is waiting for user input (via a dialog box)?

I wouldn't mind so much about the screen timeout itself, but once the screen times out, the device gets locked as well. :(

  • 2
    Closely related: Is it possible to temporarily disable the screen timeout ? – ale Mar 31 '11 at 17:22
  • If this is something you're trying to incorporate into your app it would be better asked at Stack Overflow. – ale Mar 31 '11 at 18:14
  • @Al Everett Actually, I was trying to avoid modifying my app to achieve this. I thought that I may be missing a hidden setting somewhere. – an00b Mar 31 '11 at 21:18
  • Gotcha. – ale Mar 31 '11 at 22:03

You can user Tasker to control the timeout for individual apps.

| improve this answer | |
  • 1
    Thanks +1. If there isn't a free solution, this will be the accepted answer. – an00b Mar 31 '11 at 21:24
  • I found this free solution called KeepScreen: market.android.com/details?id=com.tni.KeepScreenLite . It seems to be working (the service needs to be started manually). – an00b Mar 31 '11 at 23:57
  • 1
    Celebration was early. The KeepScreen app seems not to work. I guess YGWYPF. – an00b Apr 1 '11 at 1:03

This is a developer answer, but I know that when you're coding an app for Android you have options that allow you to control the screen timeout. Google recommends that you use the user's preference by default and offer them actual options in the preferences of your app to change how your app affects the screen timeout, but technically you can do whatever you want. I have a number of apps (games, PowerAmp, etc.) that I allow permission to disable my screen timeout.

| improve this answer | |
  • This is a very helpful answer. Thanks. If you happen to have pointer to the actual API for controlling the screen timeout that would be great. – an00b Mar 31 '11 at 17:47
  • 1
    @an00b - developer.android.com/reference/android/view/… – newuser Mar 31 '11 at 18:04
  • 2
    @an00b: Adobe PDF Reader only turn off the screen, but disabled screen lock unless the user presses the lock button explicitly. In their case, it is preferable to do it that way since users often read for long periods without making any input; but also, they turned off the screen to save battery (sometimes I fell asleep in the middle of reading). If your app is preventing screen timeout, then don't hold it for too long, users might went away thinking the screen will timeout then return half hour later with their battery drained (or they might fall asleep while operating the phone). – Lie Ryan Mar 31 '11 at 20:39
  • Your answer is excellent (+2 for that) but @Matthew's answer is what I was looking for in this forum. @Lie Ryan Thanks +1 for the tip. – an00b Mar 31 '11 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.