Skip to content
shivanshowPublic

About

Android app that reminds you to blink 15 times a minute while you scroll short form video.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Blink15

Version 1.0.0

People blink about a third as often while watching short form video, which is what leaves your eyes dry after an hour of scrolling. Blink15 puts a small pair of eyes on screen inside the apps you choose and blinks them 15 times a minute, the rate healthy eyes blink at, so you follow along without having to think about it.

Why the overlay is native

React Native needs an Activity to render. While you are inside Instagram, Blink15 has no Activity, so the cue has to be drawn into a WindowManager overlay owned by a background service. That splits the app in two:

Layer Where What it does
Splash SplashTheme in styles.xml Native, so it shows before RN mounts
Onboarding src/Onboarding.tsx Three pages, shown once
Home App.tsx Status, app picker, whichever permission is next
Foreground app detection BlinkService.kt Polls UsageStatsManager once a second
Cue rendering BlinkOverlayView.kt Canvas drawn eyes in a system overlay
Bridge Blink15Module.kt Permission state, app list, start and stop

Prefs.kt holds the settings, so if the OEM kills the service it can pick its state back up when Android restarts it under START_STICKY.

Detection uses UsageStats, not an AccessibilityService

An AccessibilityService would be event driven and cheaper than polling. Google Play rejects apps that use it for anything other than accessibility, so this uses UsageStatsManager instead. The cost is up to a second of latency before a cue starts, which you cannot notice against a four second interval.

The cue

One blink per cue, fifteen cues a minute:

fade in -> lids close -> lids open -> hold -> fade out    about 1.1s total
0.00      0.22          0.35         0.49    0.70   1.00  (fraction of the cue)

Nothing is drawn and no frames are requested for the other 2.9 seconds of each interval.

Two details matter more than they look:

  1. FLAG_NOT_TOUCHABLE means the overlay can never swallow a tap meant for the app underneath.
  2. The white lids sit on a 72 percent black pill and carry a dark stroke behind them. Without that they disappear into light backgrounds. An earlier version used a 38 percent pill and was measurably unreadable over YouTube's filter chips.

Screens

The splash is a real Android splash screen using androidx.core:core-splashscreen, so it appears the moment the process starts rather than after the JS bundle loads. Its background colour is repeated on the JS side for the brief handover, which is why you never see a flash of a different colour.

Onboarding runs once. The flag lives in SharedPreferences next to everything else, so there is no AsyncStorage dependency.

Home is built to fit on one screen. Two decisions do most of that work: apps that are not installed are hidden rather than greyed out, and only one permission is ever requested at a time. Once both required permissions are granted, that card disappears entirely.

The eye is drawn from two plain Views. A square with two opposite corners fully rounded is a leaf, and rotating it 45 degrees makes an eye, so react-native-svg is not needed. It blinks on the same interval the overlay uses.

Permissions

None of these can be granted from a dialog inside the app, so each one opens a Settings screen instead.

  • Usage access (PACKAGE_USAGE_STATS). Required. Detects which app is in front.
  • Display over other apps (SYSTEM_ALERT_WINDOW). Required. Draws the cue.
  • Unrestricted battery. Optional, but Motorola and Xiaomi will stop the watcher without it, usually with no warning.

POST_NOTIFICATIONS is asked for at runtime, for the foreground service notification.

Running it

npm install
npx react-native start          # terminal 1
npx react-native run-android    # terminal 2

If you would rather not tap through Settings while testing:

adb shell appops set com.blink15 GET_USAGE_STATS allow
adb shell appops set com.blink15 SYSTEM_ALERT_WINDOW allow

Measured on device

Taken from a 21 second screen recording over YouTube on a Moto G45 5G running Android 15. Frames were pulled at 30fps and the overlay isolated by subtracting a temporal median background, so YouTube's own content does not pollute the signal.

  • Cue intervals came out at 4.00, 4.00, 4.00 and 4.03 seconds, so 14.97 cues a minute.
  • Lid height across one cue went 18, 12, 5, 4, 10, 17, 24 pixels, which is a real blink of roughly 160ms rather than a fade.
  • The overlay window was present over Instagram Lite and YouTube, and gone on the launcher.

Still to do

  • No boot receiver yet, so the watcher does not come back after a restart.
  • Onboarding cannot be replayed from inside the app. Clearing app data is the only way back to it.
  • The blink rate is stored and bridged but has no control in the UI. It is fixed at 15.
  • The cue always sits top centre, where it can collide with app chrome such as YouTube's filter chips. It is not adapted for landscape either.
  • Only Instagram Lite and YouTube were installed on the test device. The other five apps are wired up but unverified.
  • Play Console will want a written justification for SYSTEM_ALERT_WINDOW, PACKAGE_USAGE_STATS and the specialUse foreground service type. Worth writing early, since it is the most likely thing to hold up a release.
  • No automated tests.

About

Android app that reminds you to blink 15 times a minute while you scroll short form video.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages