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

Web and WebWorks Development

Reply
Highlighted
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

PlayBook SDK - events deviceBatteryLevelChange vs. deviceBatteryStateChange

[ Edited ]

Hi.

 

I created a small test-app to get the battery-level and battery-status from the device. In My source-code, when calling the events, it seems to not work calling both successively, only the first of them seem to call the callback-function well after registering of the event:

some lines of source-code
...
blackberry.system.event.deviceBatteryLevelChange(onBatteryLevelChange);
blackberry.system.event.deviceBatteryStateChange(onBatteryStateChange);
...
some lines of source-code

 

In this example I get the battery-level immediately after calling the event registration, but the battery-status isn't quite coming that fast and needs to wait until the first event is fired. When changing the order of the event registration it appears to get me the battery-status back immediately and need to wait for the battery-level.

 

Regards.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.