DEV Community

Khalid Abdullah
Khalid Abdullah

Posted on

How I Built a 1.1 MB Android Utility to Replace Broken Physical Volume Buttons

Every year, thousands of Android devices suffer from the exact same hardware failure: broken, jammed, or unresponsive physical volume rockers.

Repairing them often requires opening the phone body, costing anywhere from $40 to $100. Most assistive touch apps in the market solve this poorly by placing permanent, screen-blocking floating bubbles that drain battery and trigger accidental clicks.

I decided to solve this natively: I built Gesture Volume — an ultra-lightweight (1.1 MB), privacy-first Android system utility built with modern Android standards.


🛠️ The Architecture & Engineering Highlights

  1. Unobtrusive Frosted Edge Handle:
    Instead of a floating bubble, it sits at a compact 1/3 idle size (~7dp width, ~40dp height) tucked flush against your screen edge. When touched, it expands into a full slider.

  2. Native WindowManager Overlay via Accessibility:
    Renders using WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY to float smoothly over any running app, fullscreen game, YouTube, or Netflix.

    • canRetrieveWindowContent = false (Zero window scraping, no keystroke monitoring).
    • Zero internet permissions in the manifest (android.permission.INTERNET is completely absent).
  3. Event-Driven & Zero Idle Battery Drain:
    No background polling loops or wakelocks. Touch events map directly to AudioManager.STREAM_MUSIC with subtle haptic feedback (VIBRATOR_MANAGER).

  4. 100% Modern Jetpack Compose UI:
    The companion dashboard, gesture testing sandbox, and settings are built purely in Jetpack Compose + Material 3, optimized via R8 ProGuard down to just 1.1 MB.


🚀 Try It or Support the Project

I'd love to hear your feedback on the UX and architecture!

Top comments (0)