Skip to content

9 to 11 November 2026Licence MIT

ChargeWatch

Battery alerts between paired Android phones, with no backend and no account.

Released on GitHub as an Android app.

Problem

One phone can watch another phone's charge without a backend or an account. ChargeWatch reports the chosen charge level and a full charge, while ignoring old, duplicate and self-sent messages.

System study

Both phones run the same Kotlin app and either can send or receive. The battery watch sends level updates over the ntfy relay. A transition tracker on the paired phone ignores old, duplicate and self-sent messages, then triggers each chosen-level or full-charge alert once per charge. Phones pair by QR code.

ChargeWatch phone relayThe charging phone sends battery-level updates through the ntfy relay to a paired phone. Its transition tracker ignores old, duplicate and self-sent messages, then triggers an alert at the chosen level and when full, once per charge. Both phones run the same app and pair by QR code.Phone relayChargeWatchpaired by QR codecharging phonebattery watchstreams while chargingor open, otherwise acheck about every 15minutesntfy relaypublic ntfy.sh orself-hosted, 12-hourbacklogpaired phonetransition trackerignores old, duplicateand self-sent messagesalertat the chosen level andwhen full, once perchargelevelupdatesno backend, no accountboth phones run the same app,either can send or receive
Fig. 1. ChargeWatch level updates pass through the ntfy relay to a paired phone's transition tracker and alert.

What was built

  1. A native Kotlin app that pairs Android phones by QR code over the ntfy push relay, with alerts at the chosen charge level and when full.

  2. A low-power mode that streams only while a phone is charging or the app is open. Otherwise, batched Doze-aware JobScheduler checks run about every 15 minutes, with no service or notification between charges.

  3. A transition tracker that fires each alert once per charge and ignores old, duplicate and self-sent messages, including replays of the relay's 12-hour backlog.

  4. APK Signature Scheme v3 key rotation from a committed debug key to a release key held in GitHub Actions secrets. On Android 9 and newer, a normal update moves to the new key with data intact.

  5. Both certificate fingerprints pinned in the signing script. Fork and pull request builds use throwaway keys that never reach a release.

  6. A self-updater that checks GitHub releases and verifies each APK's SHA-256 before handing it to Android's installer. It offers only builds that passed the test pipeline.

  7. An Android 14 emulator pipeline that plays a second phone, triggers both alerts, checks they do not repeat after restart, verifies key rotation in both directions and checks that a reinstalled phone keeps one identity.

  8. A stable phone identity derived from Android's per-app device id. Leaving-group messages queue for retry when offline.

Architecture

App
Kotlin and the Android SDK, with a plain android.app.Activity and the interface built in code.
Background work
A foreground service while charging or open, and batched Doze-aware JobScheduler checks otherwise.
Relay
The ntfy push relay, through public ntfy.sh or a self-hosted service. There is no app backend or account.
Pairing
QR codes read with ZXing and the Google code scanner from ML Kit.
Release
R8 with resource shrinking, apksigner with APK Signature Scheme v3, and GitHub Actions.
Verification
Unit tests plus an Android 14 emulator end-to-end test driven by Python on every build.

Key decisions

  1. Stream while charging or open, then use Doze-aware background checks so no service or notification remains between charges.

  2. Track transitions rather than repeating alerts when the relay's backlog is replayed.

  3. Pin the release certificate fingerprints and separate throwaway fork keys from release signing.

  4. Verify an APK's SHA-256 and offer only builds that passed the test pipeline before handing it to Android's installer.

  5. Derive one stable identity from Android's per-app device id so a reinstall does not leave a duplicate phone entry.

Evidence

  1. APK under 500 KB. CI rejects any build over 5 MB.

  2. 33 unit tests for the alert tracker, relay parsing and updater, plus an emulator end-to-end test on every build.

  3. About 80 to 110 relay messages per phone per day, with a background check about every 15 minutes while nothing is charging.

Screenshots

ChargeWatch main screen showing a watched test phone at 100% with an 80% alert, and this phone charging at 61%.
Main screen, test phones.
ChargeWatch notifications showing a test phone reported fully charged and this phone sharing its charging level.
Notifications, test phones.

Technology

  • Kotlin
  • Android SDK (plain android.app.Activity with the UI built in code, no AndroidX UI libraries, custom Canvas animation)
  • foreground service
  • JobScheduler
  • ntfy push relay (public ntfy.sh or self-hosted)
  • ZXing and the Google code scanner (ML Kit)
  • R8 with resource shrinking
  • apksigner with APK Signature Scheme v3
  • GitHub Actions
  • Android 14 emulator test driven by Python

Limitations and status

Messages pass through a public relay. Anyone with the group code, and the relay operator, can read them.

The app supports Android 8.0 and newer. Key rotation covers Android 9 and newer only.

Released as an APK on GitHub.

Built in three days with Claude Code from Sowan's own specifications. This project is Android application work.