A comprehensive digital wellness Android application designed to help users manage their screen time and reduce mindless app usage through intelligent app blocking and time limit enforcement.
Brain Detox is a sophisticated Android app that helps users take control of their digital habits by:
- Setting daily time limits for distracting apps
- Monitoring app usage in real-time
- Automatically blocking apps when time limits are reached
- Providing math challenges as a barrier to accessing blocked apps
- Tracking daily screen time and usage statistics
- App Selection & Time Limits: Choose which apps to monitor and set daily time limits
- Real-time Monitoring: Background service that tracks app usage continuously
- Smart Blocking: Automatically redirects users when time limits are reached
- Usage Statistics: Visual graphs and detailed breakdowns of daily app usage
- Math Challenge System: Solve math problems to gain temporary access to blocked apps
- Onboarding Flow: Guided setup with permission requests
- Intuitive UI: Clean, modern interface with Material Design components
- Real-time Updates: Live usage statistics with pull-to-refresh functionality
- Visual Feedback: Progress bars and usage graphs for better understanding
- Background Service: Persistent monitoring using Android's UsageStatsManager
- Permission Management: Handles usage access, overlay, and notification permissions
- Data Persistence: Local storage of app selections and usage data
- Daily Reset: Automatic reset of usage counters at midnight
- OnboardingActivity: Initial setup and permission requests
- MainActivity: Dashboard with usage statistics and app management
- AppSelectionActivity: Interface for selecting apps to block
- TimeLimitBlockingActivity: Blocking screen with countdown
- MathChallengeActivity: Math problem solving interface
- TimeIncreaseActivity: Time limit increase confirmation
- AddTimeActivity: Additional time management
- AppTimeIncreaseMathActivity: Math challenges for app time increases
- BlockerService: Core background service for app monitoring and blocking
- OverlayBlockingService: Overlay-based blocking implementation
- UsageUtils: Centralized usage tracking and data management
- OnboardingAdapter: ViewPager adapter for onboarding flow
- User selects apps and sets time limits
- BlockerService monitors foreground app usage
- When limits are reached, blocking mechanisms activate
- Users can solve math challenges for temporary access
- Usage data is tracked and displayed in real-time
- Android Studio Arctic Fox or later
- Android SDK 24+ (API level 24)
- Kotlin 1.8+
- Gradle 7.0+
-
Clone the repository
git clone <repository-url> cd brain-rot-app
-
Open in Android Studio
- Open Android Studio
- Select "Open an existing Android Studio project"
- Navigate to the project directory and select it
-
Build and Run
- Connect an Android device or start an emulator
- Click "Run" in Android Studio
- The app will install and launch automatically
The app requires several permissions to function properly:
- Usage Access: Required to monitor app usage
- Overlay Permission: Needed to show blocking screens over other apps
- Notification Permission: For blocking alerts and service notifications
- Foreground Service: For continuous background monitoring
These permissions are requested during the onboarding flow.
- Launch the App: The app starts with an onboarding flow
- Grant Permissions: Follow the prompts to grant necessary permissions
- Select Apps: Choose which apps you want to monitor and block
- Set Time Limits: Configure daily time limits for each selected app
- Start Monitoring: The app will begin monitoring your usage
- Dashboard: View your daily screen time and app usage statistics
- Real-time Monitoring: The app runs in the background monitoring usage
- Blocking: When you reach time limits, the app will block access
- Math Challenges: Solve math problems to gain temporary access
- Statistics: Pull down to refresh usage data
- Add/Remove Apps: Use the "Select Apps to Block" button
- Adjust Time Limits: Use "Set Time Limits" to modify daily limits
- View Usage: See how much time you've spent on each app
- Reset Data: Pull to refresh to update statistics
android {
namespace = "com.example.testing"
compileSdk = 36
minSdk = 24
targetSdk = 36
versionCode = 1
versionName = "1.0"
}- AndroidX Core KTX: Kotlin extensions for Android
- Material Design: UI components and theming
- SwipeRefreshLayout: Pull-to-refresh functionality
- ViewPager2: Onboarding flow implementation
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />- SharedPreferences: Used for app selections, time limits, and usage data
- Daily Reset: Usage counters automatically reset at midnight
- Persistent Storage: App selections and settings persist across sessions
- Minimalist Interface: Clean, distraction-free design
- Visual Feedback: Progress bars and usage graphs
- Intuitive Navigation: Simple, logical flow between screens
- Accessibility: Support for different screen sizes and orientations
- Primary: Custom blue theme
- Secondary: Complementary colors for graphs
- Text: High contrast for readability
- Background: Clean white/light theme
- Local Storage Only: All data stored locally on device
- No Cloud Sync: No data transmitted to external servers
- Permission Scoped: Only requests necessary permissions
- Transparent Usage: Clear indication of what data is collected
- Usage Stats Only: Monitors app usage, not content
- No Personal Data: Doesn't collect personal information
- User Control: Users can revoke permissions at any time
App Not Blocking
- Ensure usage access permission is granted
- Check that apps are selected and time limits are set
- Verify the BlockerService is running
Permission Issues
- Go to Settings > Apps > Brain Detox > Permissions
- Grant all required permissions manually
Service Not Starting
- Check battery optimization settings
- Ensure the app is not force-stopped
- Restart the app if necessary
The app includes comprehensive logging for debugging:
- Check Logcat for detailed service logs
- Monitor usage tracking in real-time
- Verify permission status through logs
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly on multiple devices
- Submit a pull request
- Follow Kotlin coding conventions
- Use meaningful variable and function names
- Add comments for complex logic
- Maintain consistent formatting
This project is licensed under the MIT License - see the LICENSE file for details.
- Android UsageStatsManager API
- Material Design Components
- AndroidX libraries
- Kotlin language features
For issues, questions, or feature requests:
- Create an issue in the repository
- Check the troubleshooting section
- Review the code documentation
Note: This app is designed for personal use and digital wellness. It should not be used to circumvent legitimate app restrictions or violate terms of service for other applications.