Building Android Conversation Bubbles

We recently rolled out support for Conversation Bubbles for DMs and Group DMs on Android 11. In case you’re not familiar with Conversation Bubbles, take a look at the video below. Basically, they are a way to pop out a conversation from a notification into a Bubble that will draw over other apps, making multitasking…

Mathias Roth
13 min readbeginner
--
View Original

Overview

The article discusses the implementation of Conversation Bubbles for Direct Messages and Group DMs in the Slack Android app, detailing the challenges faced and solutions devised during the development process. It covers the prerequisites for supporting Bubbles, the technical implementation, and specific considerations for user experience.

What You'll Learn

1

How to implement Conversation Bubbles in an Android application

2

Why MessagingStyle is essential for notifications in Android

3

How to manage multiple activities for a single shortcut in Android

4

When to use JobScheduler for asynchronous tasks in Android

Prerequisites & Requirements

  • Understanding of Android notification systems and APIs
  • Familiarity with Android Studio and development tools(optional)

Key Questions Answered

What are the requirements for implementing Conversation Bubbles in Android?
To implement Conversation Bubbles, notifications must use MessagingStyle, include a Sharing Shortcut, and have a BubbleMetadata object that points to a resizable Activity. These requirements ensure that the Bubbles function correctly and provide a seamless user experience.
How does the Slack app handle icon updates for Sharing Shortcuts?
The Slack app initially sets a placeholder icon for Sharing Shortcuts and uses JobScheduler to asynchronously download user avatars for the actual icon. This approach minimizes latency and ensures that users receive messages quickly while adhering to Android's background execution limits.
What challenges did Slack face when implementing Bubbles for Android 11?
Slack encountered issues with Bubbles not functioning in Android Work Profiles due to a bug in Android 11. They addressed this by using UserManager.isManagedProfile() to check for Work Profiles, allowing them to gate functionality and ensure a smooth user experience.
How does Slack ensure that Bubbles display the correct conversation content?
To maintain the integrity of the conversation displayed in a Bubble, Slack disables navigation within the Bubble and opens certain flows in the main app. This prevents confusion and ensures that users remain in the correct context while using Bubbles.

Technologies & Tools

Platform
Android
Used for developing the Slack mobile application and implementing features like Conversation Bubbles.
Tool
Jobscheduler
Used for managing asynchronous tasks related to updating Sharing Shortcut icons.

Key Actionable Insights

1
Implementing Conversation Bubbles can enhance user experience by allowing multitasking while chatting.
This feature is particularly useful in productivity applications like Slack, where users often juggle multiple conversations and tasks.
2
Utilizing MessagingStyle for notifications simplifies the development process and improves consistency across messaging apps.
By leveraging native Android APIs, developers can create more user-friendly notifications that align with platform standards.
3
Asynchronous updates for icons in Sharing Shortcuts can significantly reduce perceived latency in messaging applications.
This approach allows for a smoother user experience, especially in environments where speed is crucial, such as real-time messaging.

Common Pitfalls

1
Failing to manage the lifecycle of Bubbles can lead to confusing user experiences, such as displaying the wrong conversation.
Developers should ensure that Bubbles are correctly linked to their respective notifications and handle navigation appropriately to prevent user confusion.

Related Concepts

Android Notification Systems
User Experience Design In Mobile Apps
Real-time Messaging Infrastructure