Bubble Notifications in Android
Android 11 has amazing new features that allows developers provide great user experiences. In this course you are going to learn how to create bubble notifications to give users a quick way to access conversations with conversation shortcuts. Bubbles also give the developer sophisticated sharing and ranking capabilities, as well as improved multitasking. By Aldo Olivares.
Learning path
This is part of the Android UI & UX: Beyond the Basics learning path. View path.
Who is this for?
This course is for intermediate level Android developers who want to learn about the features provided by Android 11. In particular, this course will be useful if you are developing a chat app similar to Discord or Slack.
Covered concepts
- Conversation Shortcuts
- Direct Share through Shortcuts
- Metadata
- User Permissions
Part 1: Bubble Notifications in Android
The most important thing an Android phone does is connect people. Wouldn’t it be nice if you could feel like the people you want to talk to are right there with you? Android 11 has spectacular new features to help developers and users do just that. In this episode you are going to learn about the difference between regular notifications and conversation notifications. You are also going to learn about bubbles and the advantages they offer for sharing and multitasking.
Notifications that appear in the conversation section have a stronger visual emphasis on the avatar, highlighting who the conversation is with. Long-pressing notifications in this area shows you conversation-specific actions you can take. In this episode you will learn how to display your notifications in the conversations section.
When targeting Android 11 or higher, you have to give a shortcut to any notification you want to show in the conversation space. Shortcuts are a handy way for a user to jump right into a conversation.
Now that the code to create the shortcuts is in place, it’s time to add the ability to update them dynamically. In this episode we will add the ability to update the conversation shortcuts dynamically by adding the appropriate code to our acitivity.
Conversational shortcuts make it easy to share conversations through Direct Share. In Android 11, you can pin up to four apps to the default share menu. Otherwise, apps and conversations appear in the menu, organized contextually.
When working with bubbles, the user has the option to disallow them for certain apps or conversations, so it’s always a good idea to provide a notification with sufficient information for the bubble.
Because the user can opt out of bubble notifications for specific apps or conversations, it’s handy to know when they’ve allowed bubbling. In this episode you will learn how to display activities in a bubble and detect permissions given by the user at runtime.
An app can launch a bubble even when it isn’t in the foreground. However, the bubble won’t expand on all devices. In this episode we will discuss how background bubbles work on different devices.