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

BlackBerry® World™ Development

Regular Contributor
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

battery status issue !!!

Hi guys !!!


Thanx for the support by you last time !!!


Now a days i'm working on custom status bar application.


In which i want to show battery status. When i lowers the battery in simulator and selects USB option, i get status as 5 from DeviceInfo.getBatteryStatus().


Can anybody tell me whats this status 5 is? Coz i checked API ref. there's no BSTAT value representing 5.



Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: battery status issue !!!

Could be the number of bars the battery has remaining. 90-100% = 5?


Just a guess,


chown -R us ./base
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810
My Carrier: WiFi

Re: battery status issue !!!

Use DeviceInfo.getBatteryLevel() to get the battery power


getBatteryStatus() is used to retrieve information about is the battery charging, is it low, good etc., i.e. it returns a bitwise sum of DeviceInfo constants


check DeviceInfo constants for details

"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry