Slack Aug 25, 2021

Building Android Conversation Bubbles

Article Summary

Mathias Roth from Slack reveals how a hardcoded Android display name prefix saved their Conversation Bubbles implementation. What started as straightforward API work turned into a detective story involving work profiles, websockets, and virtual displays.

Slack's Android team built support for Conversation Bubbles on Android 11, allowing DMs to float over other apps. The implementation required MessagingStyle notifications, Sharing Shortcuts with custom icons, and a resizable embedded Activity. What seemed simple became complex fast.

Key Takeaways

Critical Insight

Slack successfully shipped Android Conversation Bubbles by solving notification lifecycle issues, websocket conflicts, and a critical Work Profile bug affecting 5% of Android 11 users.

The team's solution for handling multiple workspace websockets while a Bubble floats over the main app is surprisingly elegant.

About This Article

Problem

When conversations were marked as read in Slack, Bubbles would disappear immediately. This created a frustrating experience where opening a Bubble would cause it to close within seconds.

Solution

The team added a check to see if a Bubble was actively being used before canceling its notification. This stopped the conversation window from closing prematurely.

Impact

Users could keep Bubbles open while having ongoing conversations without them unexpectedly closing. This made it easier to multitask and read messages across different devices.