Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition

BPS battery events doesn't get updated quickly

Hi,

 

I have made one application which uses BPS battery events(same as networkinfo) in bpstutorial. I'm getting updates when there is a value change in battery. I'm displaying time_tofull the battery and time to empty both. 

 

The issue is when I connect the charger and disconnect it,it takes long time to recognize it. It displays 65635 value for long time (which is N/a value while charging) and displays proper value. How to make it work in faster way?

Rujuta Trivedi
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: BPS battery events doesn't get updated quickly

That's how it works. It extrapolates the remaining energy based on the average power over the last measurement period, and only once it has that average (after a change in charger status) is it going to have both pieces of data for the calculation.

Think about us getting in a vehicle, and starting to drive to a destination. You have no idea how fast I'm going to drive, but you know how far we're going. The instant I put my foot on the gas pedal, I ask you "How long will it take us to get there?" .... You can't answer accurately until you wait and see how fast I've been driving for awhile.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition

Re: BPS battery events doesn't get updated quickly

Thanks a lot Peter for beatiful explanation. I really appreciate that. I just wanted to make sure that I'm not doing anything wrong with my code as it take about a minute to retrieve real time rather than 65635.

Rujuta Trivedi