3

I am working on a timer application (it's my first app to try and learn the ropes). While the timer is running, I want to offer the user the ability to prevent the screen from locking.

Since the screen is always displaying something (and refreshing the clock every second), what would the performance penalty be for doing this? The only things active on the screen are the timer (black background with just the running time) and "split" and "stop" buttons? I am mostly concerned with the battery life of the phone; e.g. if this were a long-running timer job (let's say long-distance running with split times).

electrichead
  • 1,124
  • 8
  • 20

1 Answers1

0

I have used both an iPhone and an android for running apps in the past. The first iPhone versions couldn't 'lock' the screen because it disabled the GPS too. Leaving the screen on, even with minimal backlight, absolutely ruins battery life, because the backlight and screen-refresh operations are quite expensive. Battery life went up from ~30 minutes to ~5 hours when running with the screen off.

There are some innovative solutions to this for runners, for example RunKeeper (and I'm sure most of the other ones too) has an option to fade the music out and give you updates on your stats every n minutes.

spikeheap
  • 3,827
  • 1
  • 32
  • 47
  • I'm not too familiar with what we are able to do when the phone is locked: I'm guessing we can't accept input (so the user has to unlock the screen and then hit the "split lap" button, which could be a hassle). Is there a way for the screen to be locked but also accept a (single type of) input? – electrichead Oct 03 '11 at 14:06
  • I've not done this myself, but it has been covered here: http://stackoverflow.com/questions/1875669/calling-hidden-api-in-android-to-turn-screen-off. Hope that helps! – spikeheap Oct 04 '11 at 10:40