laser-android

byBhushan

You are a senior Android developer. Help me build a production-ready Android app called "Prarthana" — a faith-based screen time intervention app. CORE IDEA: Instead of allowing users to mindlessly open distracting apps (Instagram, TikTok, games), the app intercepts usage and creates a mindful pause by requiring reflection and prayer before access. PLATFORM & CONSTRAINTS: * Android only (Kotlin + Jetpack Compose) * No backend, no login, fully offline * All data stored locally (Room DB or SharedPreferences) * Must be lightweight, fast, and battery-efficient * Privacy-first (no internet required) --- ## CORE FEATURES 1. APP BLOCKING (CRITICAL ENGINE) * Use AccessibilityService (NOT UsageStats polling) * Listen to AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED * Detect foreground app package name * If app is in locally stored blocked list → trigger intervention screen * Must work in real-time with minimal battery usage 2. INTERVENTION FLOW (CORE EXPERIENCE) When blocked app is opened: * Show full-screen overlay immediately * Ask user mood (Happy, Stressed, Bored, Anxious) * Ask 1–2 short reflection questions * Based on mood → show relevant scripture/prayer * Require completion: * Tap "Done" OR * Wait minimum time (e.g., 10 seconds) * Only after completion → allow access to original app 3. MOOD-BASED CONTENT ENGINE * Map mood → questions → scripture/prayer * Store predefined local dataset * Keep content short, calming, non-preachy 4. ANALYTICS (LOCAL ONLY) Track locally: * Number of blocked attempts per day * Prayer completions * Mood logs * Daily streak (prayer consistency) Provide: * Simple dashboard * Streak tracking logic * Basic charts (lightweight) 5. APP SELECTION (USER CONTROL) * Let user select which apps to block * Store selected package names locally 6. BATTERY OPTIMIZATION * Use event-driven AccessibilityService (no polling) * Add BroadcastReceiver for: * ACTION_SCREEN_OFF → pause logic * ACTION_SCREEN_ON → resume logic * Ignore events when screen is off * Keep processing minimal 7. OVERLAY / LOCK SCREEN UI * Must be extremely lightweight * No heavy images or animations * Use simple Compose UI: * Background color * Text (prayer/reflection) * Button ("Done") * Fast render is critical 8. PERMISSIONS & RELIABILITY * Accessibility Service (core) * Overlay permission (if needed) * Usage access (optional fallback) * Request user to disable battery optimization: REQUEST_IGNORE_BATTERY_OPTIMIZATIONS * Provide user guidance screens to: * Enable Accessibility Service * Allow necessary permissions 9. FAIL-SAFE & EDGE CASES * Handle: * Service disabled by user * Battery optimization killing app * App reopening loops * Prevent infinite overlay triggers * Ensure smooth unlock experience 10. PRIVACY * No data leaves device * No tracking, no analytics servers --- ## UX PRINCIPLES * Not aggressive blocking → gentle intervention * Focus on "Pause → Reflect → Proceed" * Calm, spiritual, minimal design * Avoid user frustration (very important) --- ## OUTPUT REQUIRED Provide: 1. Full architecture (MVVM recommended) 2. Folder/project structure 3. AccessibilityService implementation 4. BroadcastReceiver for screen state 5. Room database schema + DAO 6. Jetpack Compose UI for: * Overlay screen * Dashboard * Onboarding/permissions 7. Mood → content mapping logic 8. Streak calculation logic 9. Permissions handling + user guidance flow 10. Step-by-step build plan (MVP first) Keep code clean, modular, and production-ready.

No preview

Comments (0)

No comments yet. Be the first!

Architecture

No Services Diagrams Yet

Architecture diagrams will be automatically generated when the Project Manager creates tasks for your project.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.

No completed page designs yet.

Completed design pages will appear here when they are ready to preview.

No user flows yet.

The User Flow Agent will generate per-persona navigation diagrams after SRD updates.