IdleTrack is an Android app that measures how long your phone stays
physically idle during the day.
It uses motion sensors and smart background tracking to calculate real
idle time accurately --- even on phones with Always-On Display (AOD).
- 📊 Tracks daily phone idle time
- 💤 Works accurately on AOD and non-AOD devices
- 🎵 Automatically ignores idle time while:
- Watching videos
- Playing music
- During calls or alarms
- 🔔 Foreground service with persistent notification
- 🔄 Auto resets idle time at midnight
- 🚀 Auto restarts tracking after device reboot
- 🎯 Start / Stop tracking button
- ⚡ Android 8 to Android 14 compatible
IdleTrack defines Idle as:
No physical movement
+ No media playing
+ No user interaction for 30 seconds
Sensors detect motion start/stop.
A background timer ensures long idle periods are counted even when
Android slows sensor updates.
Scenario Idle Counted
- Phone lying still on table ✅ Yes
- Phone with Always-On Display ✅ Yes
- Watching YouTube / Netflix ❌ No
- Music playing ❌ No
- Incoming call / alarm ❌ No
- Phone picked up ❌ No
- Java
- Android SDK
- Foreground Service
- Accelerometer Sensor
- AudioManager
- SharedPreferences
- Material Design UI
Permission Purpose
FOREGROUND_SERVICE Run background tracking
FOREGROUND_SERVICE_HEALTH Sensor-based foreground service
ACTIVITY_RECOGNITION Motion detection
POST_NOTIFICATIONS Show persistent notification
RECEIVE_BOOT_COMPLETED Restart tracking after reboot
WAKE_LOCK Keep service stable
All permissions are used only for idle-time calculation.
No personal data is collected or shared.
-
Clone the repository:
git clone https://github.com/TutorialsAndroid/IdleTrack.git -
Open in Android Studio
-
Run on a real device (recommended)
-
Grant requested permissions
-
Tap Start Tracking
- Uses foreground service with visible notification
- No restricted battery-optimization requests
- No personal data collection
- Android 14 compliant foreground service declaration
- Weekly & monthly history charts
- Home screen widget
- Dark mode
- CSV export
Developed by Akshay ( TutorialsAndroid )
MIT License --- free to use and modify.
Give the repo a star ⭐ and feel free to contribute!