Skip to content
← Back to blog

November 15, 2026 · 3 min read

My music visualizer on Android: the same web app with Tauri v2

How I took my music visualizer to Android by reusing the web page: the whole phone's audio through the Visualizer API, the song from notifications, an overlay above other apps and my own F-Droid repository.

In this post
  1. One codebase
  2. The whole phone’s audio
  3. What’s playing
  4. An overlay above other apps
  5. Debugging a WebView on the phone
  6. My own F-Droid repository
  7. What I learned

Visualizer is my music visualizer: animations that move with whatever is playing and take the colors of the album art, on the web and on Linux. With the Linux app working, the phone was next. The question was whether it could be the same app. Tauri v2 also builds for Android, and its scenes are WebGL2 in a web page: in theory, Android’s WebView runs them just the same.

In practice the page ran almost unchanged. What had to be written was the same as on Linux: the three things a page can’t do on its own.

One codebase

In Rust, the app became a library: the desktop-only parts (PipeWire, layer-shell, the tray) went behind #[cfg(desktop)]. The Android parts are in Kotlin, in the project Tauri generates, and the page sees them as a window.RossAndroid object. The page checks isAndroid and picks where the audio and the song come from; the scenes never know.

The whole phone’s audio

Android has an old, little-known API: Visualizer. Opened on session 0, it delivers the mix of everything the phone plays: Spotify, YouTube, any app. It needs the microphone permission (even though it doesn’t use the microphone) and delivers 8-bit samples, low resolution but enough for bands and beats.

Kotlin reads those samples and hands them to the page as base64. The page runs its 1024-point FFT and from there everything is the same as on the web.

What’s playing

For artwork and buttons, Android has MediaSession: each player publishes what’s playing, with artwork and controls. Reading other apps’ sessions requires notification access, through a NotificationListenerService. That sounds invasive, so the app’s tutorial explains what each permission is for before asking.

With that, the app knows the song, shows the artwork and has previous, play/pause and next, without signing in to Spotify.

An overlay above other apps

On Android, the overlay is a foreground service showing a WebView in a TYPE_APPLICATION_OVERLAY window that doesn’t take touches. The overlay page ships inside the app and loads through WebViewAssetLoader, with no server.

One rule from Android 12 onward shapes the design: for touches to reach the app underneath, the overlay must be at most 80 % opaque. Otherwise the system treats it as a covering window and blocks touches. That’s why the Android overlay has an opacity slider from 20 to 80 %.

It keeps running with the app closed and turns off from its notification.

Debugging a WebView on the phone

To see the page’s errors inside the app, I enable the WebView’s remote debugging, forward it to my computer with adb forward and connect with Playwright over Chrome’s protocol. That lets me read the console and run code in the page running on the phone. That option is only on in test builds, never in the released one.

I tested it all on a Samsung A56 with Android 16: system audio, Spotify artwork, controls, landscape and the overlay above other apps.

My own F-Droid repository

I couldn’t publish on Google Play without paying, and I wanted automatic updates. F-Droid supports self-hosted repositories, so the same deploy behind repo.rossmel.com builds one:

  • GitHub Actions builds and signs the APK with the real key, kept as a secret.
  • The deploy generates the index with fdroidserver, installed from PyPI because Ubuntu’s was too old to read current APKs.
  • The icon goes in separately, because fdroidserver doesn’t read Android’s adaptive icons.

Now the app on my phone installs and updates from that repository, like any other F-Droid app.

What I learned

  • Tauri v2 really does cover desktop and Android with the same page: the native part shrinks to a small bridge per platform.
  • Android has old APIs that solve hard problems (session 0’s Visualizer), but you have to explain to users why you ask for each permission.
  • Platform rules shape the design: the 80 % opacity limit became a slider.
  • A self-hosted F-Droid repository is a good alternative when the official store isn’t an option.

Rossmel Abasto — Frontend → Fullstack Developer. LinkedIn · GitHub

Leer este artículo en español →See the case studyVisualizer →A real-time music visualizer: the colors come from the album art and the motion from the sound. On the web, Linux and Android.

Keep reading

Write to me: I read everything and reply by email.

Questions or comments about this post?

send-mail.sh