PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

iPhone - Battery level

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