[ELECTRONIC MUSIC PLAYING]
ARTUR TSURKAN: Hi, my name is Artur.
I'm a product manager on the Android System UI team.
And today, I am here to talk to you about all the new features
we're introducing around conversations in Android 11
and how to get them working in your app.
This release, we focused on improving
one of the core functions of the phone--
connecting people.
Today, there are many ways that apps
help us engage with each other.
And we really wanted to elevate these across the operating
system to make it feel like the people in your life
are right there with you.
We're building off the API foundation
around shortcuts from previous releases
to enable your apps to provide an end-to-end experience
around conversations.
By integrating with the single API,
you'll be able to help users in a variety of tasks,
like starting new conversations through pinnable shortcuts
on the launcher, sharing to conversations
through conversation suggestions in the Sharing menu,
seeing updates from conversations, which now appear
above notifications, and quickly getting back to conversations
without having to switch apps through bubbles.
The key ingredient is building a conversation shortcut.
Conversation shortcuts are shortcuts
with the right combination of metadata and properties
so that they can be used across conversation-related features.
To create these, you'll need to publish a regular shortcut
with all of the essential details,
like an icon, name, and intent.
Most importantly, you'll need to set it as long-lived
so that the operating system knows to keep track of them.
While there are many applications of conversations,
conversation shortcuts are meant to refer to activities
centering around real-time conversations with real
people--
for applications like chat apps.
Conversation shortcuts aren't meant for bots or for messages
which users cannot or wouldn't respond to, such as one-way
announcements, or wouldn't respond to in real time,
such as updates or posts.
Let's talk more about building a conversation shortcut.
First, it's recommended that you define the contact or contact's
details related to the conversation using
Android's Person class.
This is not required to build a conversation shortcut,
but I strongly recommend it, because it gives the operating
system more context about the conversation
and is helpful for ranking the shortcut in features
like sharing suggestions.
The Person object you create can also be reused in other APIs
to make integration easier and quicker.
Next, you build the shortcut.
You'll wanted to define an ID scheme
for each of your shortcuts.
This is up to your app and needs to be unique for each shortcut.
You'll need to set the shortcut to be
long-lived in order for it to be a valid conversation shortcut.
Then, you'll need to set the short label and intent.
You can reuse the Person icon attribute
from the Person object to define an icon for the shortcut
and refer to the Person object in the shortcut definition.
You can specify a category for the shortcut, which
describes the data types that a shortcut can receive when
a user wants to share content.
You'll need to implement this in order
for your conversation shortcut to appear in the sharing menu.
Finally, you'll want to publish your conversation shortcut
as a dynamic shortcut.
The operating system limits apps to publish only 10 shortcuts
at a time.
However, we've introduced the pushDynamicShortcut method,
which automatically handles logic related to this limit.
Setting a shortcut to be long-lived means that it'll
be automatically cached by the system
so that it can be referred to across the various ways users
will interact with conversations in the OS.
Developers are able to remove conversations from the cache
by using the removeLongLivedShortcuts method
in Shortcut Manager.
Apps should only do this if the user
is no longer able to access these conversations
from within the app--
for example, if a user has deleted or blocked a contact.
So what are all the awesome things
you can do with conversation shortcuts?
Well, aside from being pinnable on the launcher
and prioritized in the Sharing menu,
we're making it easier to see updates
from conversations in the Notifications pane
in Android 11.
Apps which push messaging-style notifications that
refer to valid conversation shortcuts
will appear in a dedicated section
above other notifications.
Conversation notifications make it easier
to see a sender's avatar, name, and message.
These notifications will also have enhanced features.
Users can selectively bubble or pop out a conversation so
that they can quickly access it without switching apps.
Users can also long press on a conversation
to set it as priority.
Think of priority conversations as providing
a quick set of default settings to make your most important
conversations be more visible and easy to get to
across the OS.
Priority conversations appear at the top of the conversation
section, and the sender's avatar appears on your Always On
display, lock screen, and status bar when you get an update.
Priority conversations will also break through Do Not Disturb
mode and bubble by default.
Adding the conversation shortcut to your messaging style
notification is very easy now that you've
done all the hard work to define the shortcut.
Just set the shortcut ID from the conversation shortcut
you defined previously.
You should also be able to reuse the Person object
from before when constructing your messaging style
notification.
And that's it.
Once you publish this notification,
it will appear in the Conversations section.
We want to make the migration to Android 11's
new Conversation section as smooth as possible for users
and for apps.
Because many apps already publish
messaging-style notifications, these
will still appear in the conversation section
above other notifications until these apps target Android 11.
However, users won't be able to bubble these for multitasking,
and they won't be able to mark them as priority conversations
when they long press on the notification.
Instead, we will provide an educational tip for the user.
Awesome.
Now, let's talk about bubbles.
Bubbles allow you to chat while multitasking.
They float over whatever you're currently doing on the phone.
When you tap on a bubble, a floating conversation window
will appear so you can see and respond in the chat.
You can go back to what you were previously
doing by collapsing outside of the bubble.
This makes it really easy to get back to chats
without having to open or switch apps.
In Android 11, users can create a bubble
by tapping on the button on the notification.
Developers can reuse the conversation shortcut intent
to create bubble metadata.
Let me show you.
Bubbles are constructed by adding the bubble metadata
to the notification.
You can define a separate intent for this
or just reuse the intent from your conversation shortcut.
In this case, we're defining the intent
by referring to the conversation shortcut ID
and creating a notification which
both refers to that shortcut and uses the bubble
metadata we've just defined.
Users are in control of what notifications
get to produce bubbles.
This is really important so that the updates
don't get overwhelming.
There are two ways users can get bubbles from notifications.
They can set specific conversations to bubble
by tapping on the bubble button on the bottom right
of the notification.
This will immediately open the bubble.
And after a bubble is dismissed, new messages
will cause the bubble to reappear.
To stop getting future updates as bubbles,
users can tap on the bubble icon on the notification
again, or tap on the Manage button
on the bottom left of the expanded bubble window.
Users can also set every conversation
from the app to bubble.
This has to be done in the app's notification settings
in the Settings app.
Apps can deep link to the setting using a system API.
We strongly recommend that you do this
only if users understand what will bubble,
and that having these conversations as bubbles
is useful.
In order for either of these paths to work,
you must provide bubble metadata in your conversation
notifications.
When a user creates a bubble for a conversation,
it means it's important, and that they
want to be able to quickly and easily access it.
So only offer the option for appropriate conversations
that are real time and with real people.
Bubbles are a new way for users to interact with your chat app,
because they float over top of other apps that you have open.
Here are a few tips and guidelines to make sure
your app's activities work correctly
in this new multitasking mode.
First, it's really important that your bubble activities
are realizable.
Because bubbles are housed in a floating window,
they will be resized to fit.
Second, focus bubbles on new tasks.
For conversations, this just means the chat window.
Minimize navigation to other parts
of the app within the bubble.
For example, users shouldn't be able to navigate
to another chat from a bubble.
While this makes a lot of sense when
the chat window is full screen, it
can be confusing in a bubble.
Lastly, actions which create a new task in the OS task stack
will collapse the bubble window and redirect
to a full-screen experience.
An example of this is opening a link from a website.
You're able to reopen the bubble after the user is done
with a new task, but be prepared to design around these use
cases.
That just about covers it for all of the new conversation
features in Android 11.
We're excited to have you use these APIs to make
your app's conversation experiences
shine across the OS.
Thank you for listening.
[MUSIC PLAYING]