pClock
A small Android clock app built with Kotlin and Android framework classes. No AndroidX, Compose, Material libraries, coroutines, database libraries, network access, or third-party runtime dependencies. The Kotlin Gradle plugin supplies the Kotlin standard library. The pUI resources and helpers are source files copied from the suite's shared style kit.
Features
- Alarms: add, edit, delete, enable, label, weekday repeats, vibration, five-minute snooze.
- World clock: local time and searchable offline Android time zones; follows the system's 12/24-hour setting.
- Stopwatch: start, pause, resume, reset, and up to 1,000 laps with split and total times.
- Timer: hours/minutes/seconds, pause, resume, reset, and a background alert.
- System light/dark appearance, native controls, scrollable screens and system-bar insets.
AlarmManager schedules alerts independently of the activity. A foreground service plays the system alarm tone and provides Dismiss/Snooze notification actions. Multiple simultaneous alerts queue for dismissal. Alerts silence after ten minutes. Alarms and active timers are restored after a restart (after the first unlock) or app update. Disabled alarms stay disabled. Wall-clock alarms are recalculated when the time or time zone changes. Running timers and the stopwatch use elapsed real time so changing the phone clock does not change their duration.
Stopwatch state and laps survive closing the app; a phone restart stops the stopwatch at its last saved snapshot. After a phone restart an active timer uses its saved wall-clock deadline; an overdue timer rings after unlock. The phone must be on for alerts to ring. Force-stopping the app prevents delivery until it is opened again.
Build and verify
Requires JDK 17, Android SDK 35, and the Gradle wrapper. Set ANDROID_HOME or create an
untracked local.properties with sdk.dir pointing to your SDK.
.\gradlew.bat :app:checkClockMath :app:lintDebug :app:assembleRelease
The dependency-free JDK checks cover weekly scheduling, rollover, snooze, DST gaps/overlaps,
invalid time inputs, and elapsed-time formatting. Release APK: app/build/outputs/apk/release/.
The shared signing script uses the suite's RELEASE_* configuration, falling back to a debug
key if no release configuration exists. version.properties controls the version. The
package is x.vladgba.clock, minimum Android 8.0 (API 26), target API 35.
adb -s <device-serial> install -r app/build/outputs/apk/release/pClock-1.0.0-release.apk
adb -s <device-serial> shell am start -n x.vladgba.clock/.MainActivity
Phone setup
Open Alerts in the app to manage notifications, alarm access (Android 12/12L), lock-screen
alerts (Android 14+), and alarm volume. Android 13+ uses USE_EXACT_ALARM, appropriate to this
dedicated alarm-clock app. Notification access is required before starting an alarm or timer.
Without lock-screen access, use the notification to open the ringing controls. Muted alarm
volume, Do Not Disturb, blocked notification channels, and manufacturer battery restrictions
can affect alerts. Check a short timer on your phone before relying on a wake-up alarm.
Platform references: exact alarms, foreground service types, notification permission.