views:

348

answers:

1

I'm developing something like a stopwatch, so I have to turn off that below 20% battery alert view somehow during a time measuring session (I will inform the user about battery percentage elsehow).

I just couldn't google for any answer.

+3  A: 

You can't do this using the public iPhone SDK.

Mike
Whoa.Then what is the best way to ask for the battery percentage?UIDevice class? Is the system alert launched on an actual 20% (Maybe I can inform the user on 30% before starting a time measuring session)?
Geri
To get the battery life, you can use `[[UIDevice currentDevice] batteryLevel]`, which will give you a float between 0.0 and 1.0. http://stackoverflow.com/questions/1469549/iphone-calculating-battery-life explains how to get notifications about battery life.
Mike