Skip to content

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).

Notifications You must be signed in to change notification settings

TutorialsAndroid/IdleTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📱 IdleTrack

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).


✨ Features

  • 📊 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

🧠 How Idle Detection Works

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.


📸 App Behavior Summary

Scenario Idle Counted


  1. Phone lying still on table ✅ Yes
  2. Phone with Always-On Display ✅ Yes
  3. Watching YouTube / Netflix ❌ No
  4. Music playing ❌ No
  5. Incoming call / alarm ❌ No
  6. Phone picked up ❌ No

🏗️ Tech Stack

  • Java
  • Android SDK
  • Foreground Service
  • Accelerometer Sensor
  • AudioManager
  • SharedPreferences
  • Material Design UI

🔧 Permissions Used

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.


🚀 Installation

  1. Clone the repository:

    git clone https://github.com/TutorialsAndroid/IdleTrack.git

  2. Open in Android Studio

  3. Run on a real device (recommended)

  4. Grant requested permissions

  5. Tap Start Tracking


🏁 Play Store Compliance

  • Uses foreground service with visible notification
  • No restricted battery-optimization requests
  • No personal data collection
  • Android 14 compliant foreground service declaration

📅 Future Improvements

  • Weekly & monthly history charts
  • Home screen widget
  • Dark mode
  • CSV export

👨‍💻 Author

Developed by Akshay ( TutorialsAndroid )


📄 License

MIT License --- free to use and modify.


⭐ If you like this project

Give the repo a star ⭐ and feel free to contribute!

About

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).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages