webOS Nation Forums >  webOS developer forums >  Official Classic > Battery level API in classic
Battery level API in classic

  Reply
 
LinkBack Thread Tools Display Modes
Old 12/04/2009, 04:48 PM   #1 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default Battery level API in classic

It seems Classic does not properly emulate the API in Palm OS to retrieve the battery level. In my apps I call:

SysBatteryInfo( false, NULL, NULL, NULL, NULL, NULL, &percent )

to retrieve the current battery level and display it in my app. When run under Classic, it always returns 100%.

Is there another way I can get the true battery level (from within a Palm OS app, not using webOS calls)? I realize on the Pre you get the battery icon on the top row, so if I can't get the true percentage I'll just have to hide my value when running under Classic.
PreOwned is offline   Reply With Quote
Old 12/07/2009, 04:38 AM   #2 (permalink)
webOS Developer
 
Classic by MotionApps's Avatar
 
Join Date: Jul 2009
Posts: 350
Likes Received: 0
Thanks: 162
Thanked 70 Times in 43 Posts
Default

Check the Classic Compatibility Guide.pdf within Certification Kit http://www.motionapps.com/classic/fi...icationKit.zip

It should be of assistance with things like this.
__________________
Follow us on Twitter

Hang out with us on Facebook

Stay Tuned with news and updates on our blog
Classic by MotionApps is offline   Reply With Quote
Old 12/07/2009, 05:18 AM   #3 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
Originally Posted by Classic by MotionApps View Post
Check the Classic Compatibility Guide.pdf within Certification Kit ... It should be of assistance with things like this.
I can't find that it makes any reference to this not working. The closest thing may be page 24 where it says Classic does not support the "Hardware Utility Library".

I know the battery level is readily available under webOS, so I don't know why Classic couldn't support at least the percent level value from this API.
PreOwned is offline   Reply With Quote
Old 12/07/2009, 05:37 AM   #4 (permalink)
webOS Developer
 
Classic by MotionApps's Avatar
 
Join Date: Jul 2009
Posts: 350
Likes Received: 0
Thanks: 162
Thanked 70 Times in 43 Posts
Default

Quote:
Originally Posted by PreOwned View Post
I can't find that it makes any reference to this not working. The closest thing may be page 24 where it says Classic does not support the "Hardware Utility Library".

I know the battery level is readily available under webOS, so I don't know why Classic couldn't support at least the percent level value from this API.
Just checked with development team and it is as you said - you would not be able to "read" battery state correctly from within Classic, so it is the best to exclude this function all together.
__________________
Follow us on Twitter

Hang out with us on Facebook

Stay Tuned with news and updates on our blog
Classic by MotionApps is offline   Reply With Quote
Old 12/07/2009, 06:08 AM   #5 (permalink)
Member
 
Join Date: Jul 2009
Posts: 44
Likes Received: 0
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
Originally Posted by Classic by MotionApps View Post
Just checked with development team and it is as you said - you would not be able to "read" battery state correctly from within Classic, so it is the best to exclude this function all together.
I'll have to settle on that for now, but considering how compatible you are with most everything else, consider this a request to add this feature too.
PreOwned is offline   Reply With Quote
Old 12/07/2009, 06:25 AM   #6 (permalink)
webOS Developer
 
Classic by MotionApps's Avatar
 
Join Date: Jul 2009
Posts: 350
Likes Received: 0
Thanks: 162
Thanked 70 Times in 43 Posts
Default

Quote:
Originally Posted by PreOwned View Post
I'll have to settle on that for now, but considering how compatible you are with most everything else, consider this a request to add this feature too.

noted!
__________________
Follow us on Twitter

Hang out with us on Facebook

Stay Tuned with news and updates on our blog
Classic by MotionApps is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0