andrew
andrew

Reputation: 1244

c# windows mobile battery %

I'm following this article on how to get the battery status on a windows mobile device:

http://msdn.microsoft.com/en-us/library/aa457088.aspx

This works well when the PDA is not being charged; the % returns matches what is seen on the power screen of the PDA.

However when the PDA is charging, the % returned is 100. i've also compared all the class member values when charging and not charging and can't see anything I could use in place of BatteryLifePercent.

I can use ACLineStatus or BatteryFlag to detect if charging, but it would be great to show the user something like "Charging.. 88%" so they know when the charge has reached 100%.

Has anyone come across this before ?

Apologies if my prior searching was inadequate and the answer is here somewhere.. please let me know.

Andrew

Upvotes: 2

Views: 1121

Answers (1)

ctacke
ctacke

Reputation: 67178

The result you're getting is what the battery driver is providing to the power manager. If it's giving you 100% when plugged in (many do) then that's all the info you can get (unless the device OEM added some sort of proprietary API to query it, which I'd doubt).

Upvotes: 3

Related Questions