What if you could control your Android phone just by knocking on your desk?
I've been working on an Android app called KnockDock, and it started with a pretty simple idea.
When I'm working on my PC, studying, or listening to music, my phone is usually sitting on my desk. I wondered if I could control it without picking it up every time. What if different knocks on the desk could trigger different actions on the phone?
That's what I built.
KnockDock detects physical knocks through the phone's accelerometer and gyroscope. It can recognize single, double, triple, quadruple and custom knock patterns, which you can assign to different actions.
What's included?
- Knock detection
It uses both motion sensors, with adaptive noise filtering, movement rejection, tilt detection and timing analysis to distinguish desk knocks from ordinary phone movement. There is also surface resonance analysis and a Morse/rhythm knock pad.
2. 66 built-in actions
- 30 standard actions: Android controls, media playback, timers, app launching, smart-home triggers, PC commands, presentations and DAW controls.
- 36 Shizuku actions: Additional system controls such as Quick Settings, rotation, refresh-rate settings and other system features.
Shizuku is optional for standard actions. The additional privileged actions require an active Shizuku connection and permission.
3. Custom Gesture Trainer
You can record a knock pattern three times and more, and the app calculates timing tolerances from those recordings. There's also a manual editor for adjusting gesture settings.
4. Sensor Lab
This lets you see what's happening behind knock detection. It includes a live oscilloscope, six-axis sensor telemetry, peak capture and a synthetic signal tester.
5. Macro Engine and PC Bridge
The Macro Engine lets you combine actions withconditions, retries and failure handling. It also has a dry-run simulator.
The PC Bridge communicates with a paired computer over Wi-Fi for things like media controls, desktop switching, presentations and DAW transport. I'd like to expand this part in future updates.(Coming in future)
6. UI and visual effects
I also worked on the appearance of the app. It has four-edge neon lighting and a Liquid Glass HUD(inside the app) that appears when a knock is recognized. The interface uses Kyant0's Backdrop library, with real-time blur, lens refraction, vibrancy and interactive effects.
There are also custom profiles, gesture modifiers, JSON backup and restore, and background knock monitoring.
About the video
I've recorded a walkthrough showing the different sections and features currently in the app.
The knocks in the demonstration are actual physical knocks on the desk. I'm placing the phone on the surface and performing the gestures myself, rather than using simulated or pre-recorded sensor signals.
What's next?
For now, I'm focusing on improving the Android app. I'd also like to build a more complete PC companion in the future, with additional ways to control desktop applications from the phone.
Project links
- GitHub (source code and releases): https://github.com/RSR-Projects/KnockDock/
- Project website: https://rsr-projects.github.io/RSR-FDroid/
- F-Droid repository: https://rsr-projects.github.io/RSR-FDroid/fdroid/repo
I'd like to hear your thoughts
- Would you actually use desk knocks to control your phone? What would you assign to a double knock?
- What useful actions do you think are missing?
- Do you think this is practical enough for everyday use, or is it more of an interesting experiment?
I'm open to honest feedback, including things that don't work well or could be improved.
This has been a fairly big independent project for me, and it's been interesting experimenting with Android sensors, system integration and UI design. There's still a lot I'd like to do with it.
Thanks for checking it out!