Menu

How I built a Reels and Shorts blocker for Android with AccessibilityService
📰

How I built a Reels and Shorts blocker for Android with AccessibilityService

DEV Community: android·Adem Ladhari·8 days ago
#51DdkVhv
#devtoandroid#devto#dev#service#android
Long article (1101 words) — no AI summary yet.
Reading 0:00
15s threshold

Most app blockers on Android work at the app level: Instagram is either allowed or blocked. I wanted something narrower. Instagram DMs should work and Reels should stop. YouTube tutorials should work and Shorts should stop.

So I built Focsy: Doomscrolling Blocker . You can block a whole app, or only the short-video part of it. Here's how the core works, what kept breaking, and what I'd tell anyone building something similar.

Why AccessibilityService

Android gives a normal app no way to see what's on screen inside another app. The only API that can is AccessibilityService . It receives events when windows change and can read the view tree of the app in front.

That power is exactly why it's sensitive. Three rules I set before shipping:

Only blocking. The service never stores or sends screen content.

No third-party SDKs anywhere near it.

The user turns it on themselves, after a clear explanation of what it does.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.