(upbeat music)
Hi everyone, I hope you’re enjoying your time today at Google I/O.
Welcome to this technical session where you’ll learn what’s new
with Android app shortcuts & how they can be extended to the Google Assistant.
My name’s Alec Truitt. I work on global product partnerships for Google Assistant.
My team works with partners to explore assistant platform features
& create exciting experiences for the users.
I’m based in the New York city area, & have been at Google for almost 10 years.
Today, we’ll walk through an overview of Android app shortcuts & how they can be
extended to the Google Assistant. After that we’ll review ways mobile app developers
can expand their shortcut’s integration even further across Android & Assistant.
- My name is Preethi, and I am a partner technology manager here at Google.
My team works with partners and developers
to build exceptional integrations on the system platform.
I’m based out of the San Francisco Bay area, and I've been at Google over eight years.
Let's talk about app shortcuts for the Android platform.
Launched in 2009, Android app shortcuts provide a convenient way
for your users to interact with your apps, whether it's to quickly start an activity
or jump straight into the most popular parts of your app.
So how do they work?
They pop up when users long press the app icon in the launcher,
as you can see in this example.
Developers have the power to choose exactly which shortcuts are displayed here.
Before we talk about how to implement shortcuts,
let’s take a moment to consider the value they bring to the table.
Think about shortcuts as accelerators, which navigate users into your app
from across Android and Google.
It’s a convenient tool that developers can use to build once
and let Google do the work of plugging into many places
like the Google Assistant and even search.
Core Android APIs provide the infrastructure and a strong toolkit
that developers can use to enable these experiences
across devices and surfaces.
This means there are far more opportunities
to accelerate user navigation into your apps.
Now let's turn back to app shortcuts.
There are two types we’d like to highlight for you today: static and dynamic.
Static app shortcuts are useful to provide quick entry points
into the most common activities in your apps.
Let's take a social media app for example. Static shortcuts can be used to enable users
to quickly create social media posts or stories,
activities that are common to most users.
Let's look at a real world example to understand this better.
If you long press the eBay icon, you'll see a few apps shortcuts pop up.
These static apps shortcuts allow users to see their saved items,
items they might be selling as well as watching.
eBay chose to implement these shortcuts because they’re common to most of the users.
Here’s a code sample showing how a static shortcut can be implemented.
As you can see here, there are a number of attributes
that can be used to shape the way the shortcut appears to users.
It’s important specify a short label and a long label.
The short label is what is visible to users
and a long label is what describes the shortcut.
If we were to try to replicate the eBay example,
the short label here could be something like selling
or one of the other values you saw in the example.
And your long label can be whatever you want to describe the shortcut.
Now let's talk about dynamic apps shortcuts.
These provide quick entry points
for users to perform tasks that are personalized to them
based on context.
Taking the social media app as an example again,
dynamic app shortcuts can access you favorite celebrities to see their social media posts.
Let's look at another real world example to understand this better.
Let’s say you happen to be a frequent user of the Spotify app,
and you recently listened to artists like Ira Wolf,
or listened to playlists like good vibes.
If you happen to long press on the Spotify app,
you'll notice that these show up as options in the shortcuts.
This is because these are dynamic and personalized to the user
based on their listening history.
So how would you implement a dynamic app shortcut?
All you have to do is use the shortcut manager API.
And as you can see here, similar to static shortcuts,
there's a short label and a long label.
In this example, we’re thinking about a food or drink use case.
And so the short label,
here, the value cappuccino, is what is visible to users.
After you create this, it's easy for users to see this
if they happen to have ordered the same kind of item.
Now you've had a quick overview
of how to implement static and dynamic shortcuts,
let’s look at changes that are coming to the Android platform.
This year, we’re excited to announce changes to the shortcut manager API in shortcuts.xml,
which will make it easier to push useful shortcuts.
Starting with Android S,
the shortcut manager API will no longer have a size limit of 10 shortcuts.
So developers can build an unlimited set for their mobile apps.
This means that a shortcut can be created
for every user action in your app as they occur.
Now you can use the new Jetpack module
called the Google Shortcuts Integration Library
for backwards compatibility
and to ensure your shortcuts show up in different surfaces,
like the Google Assistant.
The Android system will take care of ranking your list of shortcuts and
making sure that the right shortcut is shown at the right time to your users.
If you happen to be using the shortcut manager compact library,
you should not need to make any changes.
This means that an unlimited set of shortcuts can be shared with certain trusted components
even before Android S.
Now let's talk about capabilities. What exactly is a capability?
These are a feature of the Android platform
which act as templates for actions that users can take
to launch into your app or to execute a task within your app.
Let's look at a code example to see how a capability would be built.
As you can see, this would be added to your shortcuts.xml.
In this example, we’re using the start_exercise capability
to perform exercise related tasks.
It's important to specify the name of the capability,
your parameter mappings, and the destination path within your app.
Keep in mind that creating shortcuts and building capabilities
will allow you to expand your reach beyond launcher
into the Google Assistant and search
where they show up as suggestions based on user activity.
If you want to learn more about capabilities and you’re familiar with app actions,
we recommend watching the session on how to voicify your app to learn about
different types of capabilities available.
There are vertical capabilities, common capabilities, and custom capabilities,
and you learn more about them through that session.
Now, let’s shift focus to talk about the Google Assistant
and learn about how these enhancements on the Android platform
can enable voice-powered experiences.
The Google Assistant is all about taking action.
And now capabilities can be added directly to your shortcuts.xml.
Not only does this combine core Android concepts,
this will enable promotion and various product experiences
which Alec will go into later in the session. Let's talk about shortcuts again
and how they can be enhanced for the Google Assistant.
Previously, we talked about static shortcuts as providing quick entry points
into the most common activities in your app.
Let's look at that from the perspective of the assistant.
This demo shows how Twitter plans to implement a static shortcut
to enable users to quickly search for trending news.
Rather than having to say the full app actions query,
which will include the app name,
users will have the option to use something much shorter and more convenient.
It could be just two words, like trending news.
This demo shows how that two-word query, trending news,
can take users exactly where they wanna go in the Twitter app.
So how would you implement a static shortcut for Assistant?
It’s important to remember that your shortcut needs to be associated with a capability.
If you recall, previously we created a capability using the start_exercise intent.
Now, you can enhance that and create your shortcut
by adding it to the shortcut.xml file,
the same place where you've got your capability.
We’re highlighting the capability binding tag here
because it plays a crucial role in associating your new static shortcut
with your existing capability.
Now let’s talk about dynamic shortcuts for the Assistant.
These allow the Assistant to push personalized shortcuts
that users would want to take action on.
Let's look at another example. Let's assume you have a user
who has a habit of reordering items on eBay.
Once eBay implements dynamic shortcuts for the reordering use case,
users will be prompted to save these shortcuts on device.
Let’s say the dynamic shortcut is just two words: “buy again”.
The next time the user wants to reorder items all they have to do is say, “buy again”,
and they will be transported into the eBay app
to get a hold of their most essential supplies.
Let’s look at how you would implement a dynamic shortcut for the Assistant.
As a first step,
it’s important to identify the capability you’re gonna associate it with.
So in your shortcuts.xml, make sure that your capability already exists.
Next, all you have to do is add one line of code
signifying that that capability is going to be associated with a shortcut.
You can do this by including the shortcut match required parameter
and setting it to true.
Next, you have to define your shortcut using the shortcut manager compat library
as you can see here.
The short label here is going to be the voice command
that users can use to quickly trigger that shortcut.
So it's important that you specify that exactly the way you want.
And your long label is what will be used to describe the shortcut.
As you can see here, it’s also important to include other aspects
like the parameter reference.
Let's recap what developers need to do
to implement static and dynamic shortcuts for the Assistant.
It’s important to remember is your shortcut needs to be associated with a capability.
So that is a first step in your implementation.
Make sure you identify your capability
and that it is included in your shortcuts.xml file.
Next, if you wanna create a static shortcut,
all you have to do is include a few additional lines of code
to your shortcuts.xml.
That’s it, you’re done. If you wanna create a dynamic shortcut,
on the other hand, you again have to start with defining your capability
and making sure it exists in your shortcuts.xml.
Then, you just add one line of code to your shortcuts.xml
to signify that that capability
is going to be associated with a dynamic shortcut.
Lastly, you can use the shortcut manager compat library
to define the dynamic shortcut.
And that's it.
After that, your dynamic shortcut can be pushed to users
so that they can perform personalized actions.
We’re excited to announce that the static and dynamic shortcuts features for the Assistant
are now available in beta.
That means developers can try it out today and launch them into your production apps.
If you wanna learn more,
we recommend checking out our newly released developer documentation
provided at this URL.
We’re excited for you to launch the features and leverage the power of Google Assistant.
And with that, I’ll hand it over to Alec who’ll talk about how the shortcuts
you create can be promoted in various product experiences.
As Preethi shared, shortcuts are accelerators that help users navigate into your app faster
across Android and Google.
This year we are excited that shortcuts will be even more connected
across our Google ecosystem. Developers only need to build once
and can extend their shortcuts integration into new places like Assistant and search.
Core Android APIs provide the infrastructure and a convenient toolkit for developers
to enable these experiences across devices and surfaces.
Now let’s take a closer look at the new ways we're extending your shortcuts integration
to enable proactive and contextual app experiences across our Google ecosystem.
By implementing your app actions capabilities
and defining applicable static and dynamic shortcuts,
your app will be eligible for new user experiences across Android and Assistant.
Shortcut suggestions are a primary example of this.
They are personalized and contextual suggestions.
that’ll be surfaced to users based on their most frequent and recent app usage.
These shortcut suggestions helps users re-engage with their favorite app features
and discover new app functionality.
Today, we’ll focus on three examples of shortcut suggestions,
including shortcut settings, suggestion chips and in-app suggestions.
One of the ways you’ll see shortcuts extend your reach into Assistant
is that static and dynamic app shortcuts
will automatically show up in shortcut settings
with no extra effort needed from developers.
The shortcut settings menu
is where users can manage their shortcuts and explore new ones to add.
Assistant will now proactively suggest shortcuts to users
based on the frequent user journeys and favorite apps.
In order to access shortcut settings, users can say,
“Hey Google, my shortcuts”, to be deep linked into the settings menu
with suggested shortcuts for the favorite apps.
If the user often picks up groceries from Walmart, they can click the plus sign to add
the suggested Walmart voice commands to their list of shortcuts.
Users can view all their shortcuts by tapping your shortcuts.
If the user wanted to customize their existing Walmart grocery time shortcut,
they can tap the edit icon to create a custom phrase such as “schedule grocery pickup”.
Then, next time the user needs to book a grocery pickup from Walmart,
they can ask Assistant to schedule a grocery pickup
and be deep linked into the Walmart app to reserve a pickup order time.
Assistant will also begin proactively suggesting static and dynamic shortcuts
to users through suggestion chips
based on the user's context and frequent app journeys.
Through one tap, the user is deep linked into the right page in your app.
For example, if a user enjoys reading the latest posts on Reddit,
Assistant could proactively show a suggestion chip to see what’s trending.
With one tap, Assistant will open the Reddit app and show posts trending today.
In order to engage with the users within your app,
you can implement in-app short cuts suggestions.
These are personalized shortcut suggestions highlighted in your app
for the most common user journeys. As an app developer,
you will control what user journeys to prioritize,
how frequently to show the shortcut suggestions,
and options to customize how the suggestions appear in your app.
Users can click the setup button to easily create a shortcut
for what they recently completed in your app so they can reengage faster next time.
As an example, if a user opens the eBay app,
and manually navigates to check the status of their bids,
they might see an in-app suggestion to create a shortcut in the system,
With one tap, the user can create the shortcut
to simply ask Assistant to “show my bids”
next time to check the status of the bids in the eBay app.
We are even working on bringing shortcuts to search surfaces on Android.
Users can already see shortcuts by long pressing predicted apps
in the quick search box on a pixel phone.
And we’re exploring more ways to suggest shortcuts to users in contexts like search
to give users direct access to your app content
based on their queries and app usage. In this example, the user shown searched
suggestions for the Reddit app to quickly re-engage
with their frequently accessed app features including trending posts.
We walked through an overview of Android app shortcuts
and how to extend them to the Google Assistant.
We then reviewed ways mobile app developers
can expand the reach of their shortcut’s integration
even further across Android, Assistant and even search.
We hope you’ll begin implementing your app actions capabilities
and defining applicable static and dynamic shortcuts for your app
to help users reengage faster with their favorite features
and discover new features in your app. Thanks for your time today to learn about
the exciting changes coming to shortcuts this year.
I hope you’ll check out our other great Google I/O sessions.
(upbeat music)