DEV Community

Khalid Abdullah
Khalid Abdullah

Posted on

Why I Built an Unbypassable, 100% Offline Android Focus App with Kotlin & Jetpack Compose

The Problem with 99% of App Blockers

We’ve all been there: You download a screen time tracker, set a 30-minute Instagram limit, and the moment you crave cheap dopamine, what happens?
You swipe the overlay away, kill the app in Recents, or uninstall it in 3 seconds.

Most blockers rely on weak software overlays that are trivial to bypass when your willpower runs low.

As an engineer struggling with compulsive scrolling, I decided to build a distraction shield that actually respects human psychology and native Android system constraints: Aegis Focus.


Key Technical Architecture:

  1. Tamper-Proof Strict Mode (DeviceAdminReceiver):
    Once a strict session is engaged, Android's native Device Administrator safeguards lock the app. You cannot force-stop, clear data, or uninstall the app until the timer finishes. Zero cheating.

  2. Adaptive Mindful Friction (5s → 30s Escalating Delay):
    Instead of jarring hard blocks that cause frustration, Aegis introduces an intentional breathing cooldown. Repeat attempts to open blocked apps dynamically increase the delay friction.

  3. 100% On-Device Privacy (Zero Telemetry):

    • NO mandatory accounts or logins.
    • NO Firebase/Mixpanel tracking or telemetry.
    • All session data lives purely in a local encrypted SQLite Room database.
    • Zero internet permission requested.

Tech Stack:

  • Language: Kotlin 2.0 (100% Coroutines & Flow)
  • UI: Jetpack Compose + Material 3
  • Local DB: Room SQLite
  • Permissions: AccessibilityService (Foreground app detection) + UsageStatsManager + DeviceAdminReceiver

Try it out & Support Indie Development:

I'd love to hear your feedback on the architecture and strict mode mechanics!

Top comments (0)