This program uses the Android Debug Bridge (ADB) to retrieve the battery level of an Android device and display it in the system tray.
- Java 8 or later
- ADB installed and added to the system PATH
- Connected Android device with USB Debugging enabled
- Clone the repository
git clone https://github.com/the-mr-compiler/battery-level-indicator.git
- Open a terminal in the src folder of cloned repository and run the following command
javac com.msoft.Main.java
java com.msoft.Main
- The program will now retrieve the battery level of the connected Android device and display it in the system tray.
- You can also import the project into your favourite IDE and build and run the project from there
- The program will continuously check the battery level and update the system tray icon every 3 seconds
- If no device is connected or USB Debugging is not enabled, the program will display error dialog.
- You can configure the time duration in the code for how frequently you want to check the battery level.
- You can add some options to the program that sends you notifications when the battery level is low
- You can also make the program run on system startup.
- Please open an issue on the GitHub repository if you run into any problems
- If you don't see the battery level in the system tray then make sure the
adb
is available in the system PATH and the device is connected and Debugging is enabled.
If you're interested in contributing to the project, please submit a pull request.