Results 1 to 8 of 8

Thread: Detect Battery Life Left

  1. #1

    Thread Starter
    Lively Member JustinLabenne's Avatar
    Join Date
    Jul 2005
    Location
    Ohio
    Posts
    64

    Detect Battery Life Left

    I am looking for a method to detect the current battery life on a pocket pc device using vb.net, vb6, or vba even.

    The devices are locked down on the production floor so users cannot access settings etc... but the device then has no method of checking the battery life left, causing some serious downtim issues within the company for people walk quite a ways back to the office to grab another device and put the other back on the charger...

    Any ideas or insights would be greatly appreciated as to methods, etc... or how to even start.

    Thanks........
    Justin Labenne
    www.jlxl.net

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Detect Battery Life Left

    hey there

    http://www.opennetcf.org (Open source Compact Framework Community) has an sdk that includes controls for battery monitor & battery life

    you can download it here (http://www.opennetcf.org/PermaLink.a...a-4c1dbe1cfef9)
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  3. #3
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Detect Battery Life Left

    Time to bring this thread back to life:

    I am using both the Battery Monitor and Battery Life.

    My problem is that the Battery Life (The visible control) doesn't update it's graphic scale. It simply keeps the value of when the program is first started.

    Anyone have any experience with the Battery Life control?

    Thanks

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Detect Battery Life Left

    Hi,
    set the interval on the monitor, and set the PrimaryBatteryLifeTrigger at the %age left you want to be alerted. The PrimaryBatteryLifeNotification event will fire when that happens, and you can take action.

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Detect Battery Life Left

    That's corrrect for the Battery MONITOR.
    However, it's the Battery LIFE control that I'm having the problem with. My BatteryLife control is enabled and set correctly. I've even programmed the BatteryLife click event to display a MessageBox that shows all some data provided by various properties of the BatteryLife control. So I know the Life control is working. However it just sits their and doesn't update it's "text" value.
    I did find a better work around anyway.
    1. Just make the BatteryLife control not visible;
    2 query the Life control for it's values;
    3 assign values to a progress bar. The graphic looks much better that way because of the gradients available in the progress bar.

    But if anyone has had the same problem with BatteryLife control (remember it's not the BatteryMonitor) please let me know.

  6. #6
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Detect Battery Life Left

    i use a timer and in the timer it updates the batterylife value
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  7. #7
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Detect Battery Life Left

    Hi,
    in that situation, so do I

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  8. #8
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,051

    Re: Detect Battery Life Left

    Ah, well in that case...

    If there's no way to get the control to self update...
    You might want to try my method it looks much better than the BatteryLife control. Just use the timer like I did to get the %remaining, "CInt" it and update the ProgressBar. The graphics look much better. Keep the (default I think) gradient (bottom-to-top) for the progress (on the ProgressBar) make it's background red and it's progress green with white bold text. I then added a nub to the end of the progress bar to make it look more like a battery. The "nub" is a label of appropriate size with a black background.

    It looks really nice.

    Thanks for the input, I just wanted to know that the BatteryLife doesn't update on it's own.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width