Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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. :(

share|improve this question
2  
Closely related: Is it possible to temporarily disable the screen timeout ? –  Al E. Mar 31 '11 at 17:22
    
@Al Everett Thanks. –  an00b Mar 31 '11 at 17:24
    
If this is something you're trying to incorporate into your app it would be better asked at Stack Overflow. –  Al E. 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. –  Al E. Mar 31 '11 at 22:03
add comment

2 Answers

up vote 4 down vote accepted

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

share|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
add comment

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.

share|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/… –  JonnyP Mar 31 '11 at 18:04
1  
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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