Page 1 of 1

iPhone - Battery level

PostPosted: Feb 26, 2009 @ 2:35pm
by Nacho84
Hi! Is the method GetBatteryLevel from ClassEDevice currently supported on iPhone? I've tried it on an iPod Touch and it's consistently reporting that the battery is full, even when the "Home screen" reports that it's charged at about 75%.

Thanks in advance for your answer!

--Nacho

PostPosted: Feb 26, 2009 @ 6:07pm
by edge
Hi Ignacio,

The battery level is part of the private API. Usage of private APIs is strongly discouraged.

A strange thing and possible bug is that the SDK reports a FULL battery status, while UNKNOWN should be returned on the iPhone.

PostPosted: Feb 26, 2009 @ 6:35pm
by Nacho84
Hi edge,

I'm using the GetBatteryLevel method, which returns a number between 0 and 255. I haven't tested it, but maybe if I make a call to the GetBatteryStatus method I will get something along the lines of BATT_UNSUPPORTED or BATT_ERROR.

In any case, I'll remove the GetBatteryLevel call from my code altogether.

Thanks for your help,

--Nacho