Android lap timer for Mini 4WD / slot tracks. Uses CameraX ImageAnalysis to detect START-line crossings, then records lap times. Optional crossing stills come from an analysis-frame ring buffer (not ImageCapture).
Current release: v4.0.0 · versionCode 26 · minSdk 29
Download a prebuilt debug APK from the Releases page (LapTimer-*-debug.apk), or build from source below.
中文说明 · Changelog · Contributing · Security
- Brightness-band crossing detection (default); optional HSV color multi-car mode
- First crossing starts the clock; later crossings record lap times
- Pre-start digital zoom (up to 4× soft cap) and torch; locked after Start
- Optional crossing photos via analysis-frame ring + short post-roll
- False-trigger guard (settings): narrower band, reject uniform shade, min lap gap
- Session history, CSV export, ZH/EN UI
| Item | Value |
|---|---|
| Android Studio | Hedgehog / Iguana+ recommended (JDK 17) |
| JDK | 17 |
minSdk |
29 |
compileSdk / targetSdk |
34 |
| Device | Back camera required |
./gradlew :app:assembleDebug
# Windows: gradlew.bat :app:assembleDebugAPK output:
app/build/outputs/apk/debug/app-debug.apk
Install:
adb install -r -t -g app/build/outputs/apk/debug/app-debug.apkUnit tests:
./gradlew :app:testDebugUnitTestDependency resolution may use Aliyun Maven mirrors configured in
settings.gradle.kts(helpful in CN networks). You can switch back to Google/Maven Central if preferred.
- Grant camera permission; pick or create a track.
- On the pre-start screen, adjust zoom / torch if needed.
- Tap Start → place phone on the track → first crossing starts timing.
- Subsequent crossings add laps; Finish saves the session.
Detection tip: keep the sample band on the lane surface; raise zoom so the car fills more of the band. Use torch + shade for stable lighting if ambient shadows cause false triggers.
CameraX Preview + ImageAnalysis
│
▼
AnalysisFacade ──► BrightnessCrossingDetector / ColorCrossingDetector
│ │
│ └── Fire → TimingSession / MultiCarTimingBoard
│
└── BurstPhotoPipeline (ring buffer → async JPEG → attach to lap)
Entry activity: MainActivityV3.
app/src/main/java/com/timming/laptimer/
analysis/ detectors + frame ring photo pipeline
camera/ CameraX preview, zoom/torch, JPEG helpers
timing/ pure lap timing boards
data/ Room + DataStore
ui/v3/ current Compose screens
See CONTRIBUTING.md. Please open an issue before large design changes.
MIT © 2026 kynasln
Hobby / DIY timing aid. Not a certified race timing system. Results depend on mounting, lighting, and settings.