Skip to content

adih-20/Watch-Battery-Alarm

Repository files navigation

Watch Battery Alarm

A Wear OS application for monitoring your smartwatch's charging state and battery level. The app notifies you (audibly and/or with vibration) when your device reaches a configurable charge threshold, helping you extend battery health.

Built with Kotlin and Jetpack Compose, using MVVM design patterns.

Home Screen Help Screen Settings Screen Threshold Screen
Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4

Features

  • Configurable Charge Threshold: Set the battery percentage at which you want to be notified.
  • Physical Notifications: Get notified via vibration, alarm sound, or both when your watch reaches the set threshold.
  • Efficient: The app runs only when launched, and the battery service activates only when charging and below threshold. The service/app automatically exits once the charging threshold is met.

How It Works

  1. The app monitors your watch's battery level while charging. The app must be manually launched.
  2. When the battery percentage reaches the user-defined threshold, a notification (vibration and/or audio) is triggered.
  3. The notification stops automatically and the monitoring service is ended.
  4. The service only runs when charging (not when discharging).

Installation

  1. Clone the repository:

    git clone https://github.com/adih-20/Watch-Battery-Alarm.git
  2. Open in Android Studio:
    Open the project and connect your Wear OS device or emulator.

  3. Build & Run:
    Deploy the app to your smartwatch.

Permissions

The app requests the following permissions:

  • WAKE_LOCK to keep the app responsive while monitoring.
  • POST_NOTIFICATIONS to send notifications. Not required, only included for Android service requirements.
  • FOREGROUND_SERVICE / FOREGROUND_SERVICE_DATA_SYNC to run the battery monitoring service.
  • VIBRATE for vibration alerts.

Configuration

  • Set Charge Threshold:
    Adjust the threshold in the app's settings (default: 80%, min: 40%, max: 100%).

  • Enable/Disable Notifications:
    Toggle vibration and audio alerts in the app.

Troubleshooting

  • Service didn't start:

    • If the device is discharging, connect it to a charger.
    • If the device is already past the threshold, lower the threshold or wait for the battery to drop below it.
  • Notification issues:

    • Ensure required permissions are granted and app is excluded from power optimizations.
    • Try restarting or reinstalling the app if notifications fail.

If all fails, please open an issue.

License

This project is licensed under the GPLv3.

Releases

No releases published

Packages

No packages published

Languages