A comprehensive parental control Android application that helps children earn phone usage time by completing real-world tasks approved by parents.
Screen Time Calculator is a parent-child linked mobile application that:
- Allows children to earn phone usage time by completing tasks
- Enforces time limits through Android Device Owner controls
- Blocks all apps when earned time runs out
- Provides parents with complete control and monitoring
- Create and manage family accounts
- Define daily tasks with customizable rewards
- Approve or reject completed tasks in real-time
- Monitor child's app usage and screen time
- View detailed reports and analytics
- Emergency unlock capability
- Security event notifications
- View assigned daily tasks
- Mark tasks as completed
- Real-time time balance tracking
- Countdown timer display
- Earn minutes through task completion
- Gamified task interface
- Device Owner Mode: Prevents uninstall and bypass attempts
- Time Validation: Detects system time manipulation using NTP
- Root Detection: Identifies rooted devices
- Integrity Checking: Validates app hasn't been tampered with
- App Blocking: Complete device lockdown when time depletes
- Kiosk Mode: Only Screen Time app accessible when blocked
- Anti-Bypass: Multiple layers of security protection
Frontend (Android)
- Language: Kotlin
- UI: Jetpack Compose with Material Design 3
- Architecture: Clean Architecture (MVVM)
- DI: Hilt
- Async: Coroutines + Flow
- Local DB: Room
- Preferences: DataStore
Backend (Firebase)
- Authentication: Firebase Auth
- Database: Cloud Firestore
- Functions: Cloud Functions (TypeScript)
- Messaging: Firebase Cloud Messaging (FCM)
- Analytics: Firebase Analytics
- Monitoring: Firebase Crashlytics
Device Management
- DevicePolicyManager (Device Owner)
- UsageStatsManager
- ForegroundService
- WorkManager
Android-app/
โโโ app-parent/ # Parent app (Master)
โโโ app-child/ # Child app (Slave) - THIS IS THE MAIN APP
โ โโโ service/ # Time tracking, app blocking, device admin
โ โโโ security/ # Anti-bypass, root detection, integrity checks
โ โโโ ui/ # Jetpack Compose UI
โ โโโ di/ # Dependency injection
โโโ core/
โ โโโ model/ # Shared data models
โ โโโ common/ # Utilities and extensions
โ โโโ designsystem/ # Material 3 theme
โ โโโ network/ # Firebase integration
โ โโโ database/ # Room database
โโโ backend/
โ โโโ functions/ # Firebase Cloud Functions
โโโ docs/ # Documentation
- Android Studio Hedgehog or later
- JDK 17
- Android SDK API 34
- Firebase account
- Node.js 18+ (for Cloud Functions)
git clone https://github.com/yourusername/Android-app.git
cd Android-app- Create a new Firebase project at Firebase Console
- Enable Authentication (Email/Password)
- Enable Firestore Database
- Enable Cloud Messaging
- Download
google-services.jsonfor the child app - Place it in
app-child/google-services.json
# Build child app (release)
./gradlew :app-child:assembleRelease
# The APK will be at: app-child/build/outputs/apk/release/app-child-release.apkSee DEVICE_OWNER_SETUP.md for detailed instructions.
Quick summary:
# 1. Factory reset the child's device
# 2. During setup, skip Google account
# 3. Enable USB debugging
# 4. Connect to computer
# 5. Install app
adb install app-child-release.apk
# 6. Set as Device Owner
adb shell dpm set-device-owner com.screetime.child/.service.ScreenTimeDeviceAdminReceiver
# 7. Verify
adb shell dumpsys device_policy | grep "Device Owner"cd backend
npm install
npm run build
firebase deploy --only functions-
Morning
- Child wakes up with 0 minutes of screen time
- Views assigned tasks for the day
- Completes tasks (e.g., make bed, brush teeth)
- Marks tasks as completed in app
-
Parent Approval
- Parent receives notification of completed task
- Reviews task completion
- Approves or rejects with optional feedback
- Upon approval, minutes are automatically added
-
Screen Time Usage
- Child uses phone for earned minutes
- Countdown timer runs continuously
- Warnings at 5 minutes and 1 minute remaining
- When time reaches 0, all apps are blocked
-
Blocked Mode
- Only Screen Time app is accessible (kiosk mode)
- Shows available tasks to earn more time
- Emergency unlock request option
- Cannot exit or bypass the app
-
Midnight Reset
- Automatic daily reset at midnight
- Tasks return to "Pending" status
- Time balance resets to 0
- New day begins
The app uses Android's Device Owner mode to ensure parental controls cannot be bypassed:
- Uninstall Prevention: App cannot be uninstalled without factory reset
- App Blocking: Hide and suspend all other apps when time depletes
- Kiosk Mode: Lock device to Screen Time app only
- Policy Enforcement: Disable USB debugging, developer options, etc.
-
Time Manipulation Detection
- Validates system time against NTP servers
- Cross-references with Firebase server time
- Detects manual time changes
- Logs security events
-
Root Detection
- Checks for su binaries
- Scans for root management apps
- Validates build tags
- Tests system write permissions
-
Integrity Validation
- Verifies app signature
- Checks installation source
- Detects ADB/developer mode
- Uses Play Integrity API
-
Service Protection
- Foreground services with high priority
- Automatic restart after device reboot
- Protection against force-stop
- Background task monitoring
The app comes with pre-configured tasks:
| Task | Reward | Description |
|---|---|---|
| Make bed | 10 min | Make your bed neatly |
| Brush teeth (morning) | 5 min | Brush your teeth in the morning |
| Brush teeth (evening) | 5 min | Brush your teeth before bed |
| Homework | 30 min | Complete your homework |
| Reading (20 min) | 20 min | Read for 20 minutes |
| Clean room | 15 min | Clean and organize your room |
| Help with dishes | 10 min | Help wash or dry the dishes |
| Physical activity (30 min) | 20 min | Exercise or play outside |
| Prepare school bag | 5 min | Pack your school bag for tomorrow |
Parents can customize rewards and add new tasks.
- Parent mobile app (currently planned)
- Weekly/monthly task templates
- Achievement badges and rewards
- Scheduled bedtime auto-lock
- Multiple children per family
- App-specific time limits
- Educational content integration
- Parental web dashboard
- This app is intended for parental supervision of minors
- Ensure compliance with local laws regarding parental monitoring
- Privacy policy must be provided for Play Store submission
- Obtain informed consent from children (age-appropriate)
- Minimum: Android 8.0 (API 26)
- Target: Android 14 (API 34)
- Device owner setup requires factory reset or new device
- Not compatible with existing Google accounts as primary
- Android Only: iOS version has significant limitations
- One Device: Child can only use one device with this app
- Factory Reset Required: Device owner setup needs clean device
- No Multi-User: Android multi-user mode may interfere
- Setup Guide - Detailed setup instructions
- Device Owner Setup - Critical device configuration
- Deployment Guide - Production deployment
- Architecture - Technical architecture details
- API Documentation - Firebase Cloud Functions API
- Security - Security implementation details
This is a private project. If you'd like to contribute, please contact the repository owner.
Copyright ยฉ 2024. All rights reserved.
For issues and questions:
- Check the Documentation
- Review Common Issues
- Open an issue on GitHub
- Version: 1.0.0
- Build Tools: Gradle 8.4, AGP 8.2.2
- Kotlin Version: 1.9.22
- Min SDK: 26 (Android 8.0)
- Target SDK: 34 (Android 14)