views:

195

answers:

3

Hi All,

I am developing an application which monitors the presence of the power supply of the laptop. If there is a power cut or restoration it will intimate me over email. It will also application monitoring and controlling over email (Basically to control my laptop from my office over email). I am done with email interfacing but I have no idea on how to monitor the power supply / battery supply from java.

If any can give some pointer on this it will be of great help.

Thanks in advance ....

+1  A: 

A quick google search turns up a java acpi library on sourceforge. Hasn't been updated since 2004 though.

Charlie
A: 

A quick and dirty way to handle this is call a native program (via Runtime.exec(...)) and parse the output. On Windows, the native program might be VBScript that uses WMI.

Adam Crume
+1  A: 

On linux, you can use /proc/acpi/battery/

KeyserSoze