# Battery level on pc

**URL:** <https://discourse.processing.org/t/battery-level-on-pc/21740>\
**Category:** Processing\
**Created:** [June 10, 2020, 4:14pm UTC](https://discourse.processing.org/t/battery-level-on-pc/21740 "2020-06-10T16:14:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanjoc](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@juanjoc](https://discourse.processing.org/u/juanjoc)\
**Post date:** [June 10, 2020, 4:14pm UTC](https://discourse.processing.org/t/battery-level-on-pc/21740/1 "2020-06-10T16:14:11Z")

</div>

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.

Thanks

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 11, 2020, 12:50am UTC](https://discourse.processing.org/t/battery-level-on-pc/21740/2 "2020-06-11T00:50:41Z")

</div>

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:

> <https://stackoverflow.com/questions/3434719/how-to-get-the-remaining-battery-life-in-a-windows-system/3434962#3434962>
