12-14-2011 02:24 PM
I can see for Playbook there are callback functions that can be registered to discover when the battery level changes, but how do you find out the initial value of the battery level?
On BB handhelds, there appears to be a straightforward API DeviceInfo.getBatteryLevel(). Anything similar for Playbook?
Solved! Go to Solution.
12-14-2011 03:38 PM
The callback would be invoked with current battery level as a parameter when you call getBatteryLevel and later when battery level is changed.
This is exactly what you were up to if I properly understood you.
12-14-2011 03:41 PM - edited 12-14-2011 03:53 PM
Sergey is right, the callback will fire the first time with the current value.
12-14-2011 06:03 PM
I understand better now.
I was testing in the Ripple simulator, which doesn't call the battery level changed callback initially, though it does when I manually change the battery charge percentage in the Device & Network Settings.
Pushing the app to the full VMWare simulator, I see that on page load that the callback is called with an initial value on page load.