Battery level on pc

Hi everyone. I am interested to know if there is a way to know the pc battery level with any code. I just found it but only for android devices.


1 Like

Getting battery information is:

  1. operating system and machine specific – what is your OS?
  2. difficult in Java, which doesn’t have any native API for this, as it is virtual machine based, not a system programming language.

However, it is possible – just hard and not for beginners or the faint of heart. Here is one example: