- Weekly Analytics: View comprehensive weekly usage patterns with interactive charts
- Home Screen Widget: Quick access to your screen time via Jetpack Glance widget
- Usage Stats Integration: Leverages Android's UsageStatsManager API for accurate tracking
- Smart Caching: Efficient Room database caching for optimal performance
- Material 3 Design: Modern UI following Material Design 3 guidelines
- Dark Theme Support: Beautiful dark purple theme (#1a0b2e)
- Animated Splash Screen: Smooth splash screen with branding (Android 12+)
- Responsive Layout: Adapts to different screen sizes and orientations
- Intuitive Navigation: Bottom navigation bar for seamless screen transitions
- Widget Customization: Configure widget update intervals and appearance
- Battery Optimization: Smart WorkManager-based updates (30-60 min intervals)
- Efficient Updates: Widget reads from cached data, not live queries
- Boot Persistence: Automatically reschedules widget updates after device reboot
- ProGuard/R8: Code obfuscation and optimization for release builds
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM (Model-View-ViewModel)
- Dependency Injection: Manual DI with repository pattern
- Database: Room (SQLite)
- Background Tasks: WorkManager
- Widget Framework: Jetpack Glance
app/
βββ data/
β βββ local/ # Room database, DAOs, entities
β βββ UsageRepository # Data layer abstraction
βββ system/
β βββ usage/ # UsageStatsManager wrapper
βββ ui/
β βββ components/ # Reusable UI components
β βββ home/ # Daily usage screen
β βββ weekly/ # Weekly analytics screen
β βββ settings/ # Widget configuration
β βββ about/ # About screen
βββ viewmodel/ # ViewModels for state management
βββ widget/ # Glance widget implementation
- Android Studio Hedgehog (2023.1.1) or newer
- JDK 17 or higher
- Android SDK API 26-36
- Gradle 8.7+
- Clone the repository
git clone https://github.com/abhi9vaidya/AppUsageTracker.git
cd AppUsageTracker-
Open in Android Studio
- Open Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned directory
- Wait for Gradle sync to complete
-
Run the app
- Connect an Android device or start an emulator (API 26+)
- Click the "Run" button (
βΆοΈ ) in Android Studio - Grant "Usage Access" permission when prompted
The app requires the following permission:
- PACKAGE_USAGE_STATS: Access app usage statistics (user must grant via Settings)
- RECEIVE_BOOT_COMPLETED: Reschedule widget updates after device reboot
For detailed deployment instructions, see:
- START_HERE.md - Simple step-by-step guide
- QUICK_DEPLOYMENT_CHECKLIST.md - Quick reference checklist
- DEPLOYMENT_GUIDE.md - Comprehensive deployment documentation
Generate Debug APK:
./gradlew assembleDebugGenerate Release APK:
./gradlew assembleReleaseGenerate Release Bundle (for Play Store):
./gradlew bundleRelease- Copy
keystore.properties.templatetokeystore.properties - Update with your keystore credentials:
storePassword=YOUR_KEYSTORE_PASSWORD
keyPassword=YOUR_KEY_PASSWORD
keyAlias=your-key-alias
storeFile=path/to/your/keystore.jkskeystore.properties to version control!
- Current date display
- Total screen time for today
- List of apps with usage duration
- Pull-to-refresh functionality
- Navigation to other screens
- 7-day usage overview
- Interactive bar chart visualization
- Daily breakdown with total hours
- Average daily usage calculation
- Color-coded usage levels
- Widget update interval configuration
- App theme preferences
- About section with version info
- Privacy policy link
- Compact home screen widget
- Shows top 3 most used apps
- Total daily screen time
- Customizable update frequency
- Battery-efficient background updates
- Local Storage Only: All data stored locally in Room database
- No Network Access: App does not connect to the internet
- No Analytics: Zero third-party tracking or analytics
- User Control: Users can clear data anytime via Android Settings
- See: PRIVACY_POLICY.md for details
Key libraries used in this project:
- Jetpack Compose: Modern declarative UI
- Room: Local database with SQLite
- WorkManager: Background task scheduling
- Glance: Widget framework
- Material 3: UI components and theming
- Lifecycle & ViewModel: State management
- KSP: Kotlin Symbol Processing for Room
See gradle/libs.versions.toml for complete dependency list.
- MVVM Pattern: Separation of concerns with ViewModels
- Repository Pattern: Abstracts data sources
- Dependency Injection: Constructor injection for testability
- Kotlin Coroutines: Asynchronous programming
- StateFlow: Reactive state management
- Debug: Development build with debugging enabled
- Release: Production build with ProGuard optimization
- Initial release
- Daily and weekly usage tracking
- Home screen widget
- Material 3 design
- Battery-optimized background updates
- ProGuard/R8 optimization
This is a personal project, but suggestions and feedback are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is available for personal and educational use. Please provide attribution if you use significant portions of the code.
Abhinav Vaidya
- GitHub: @abhi9vaidya
- Built with Android Jetpack libraries
- Inspired by Digital Wellbeing apps
- Material Design 3 guidelines
- Android developer community
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing documentation in the repo
- Review the deployment guides for common problems
Future enhancements being considered:
- Custom time range selection
- App category grouping
- Usage goals and alerts
- Export data to CSV
- Comparison with previous weeks
- Focus mode integration
- Dark/Light theme toggle