Google Assistant Slices for Android — part 2

Android app tight integration with the assistant

Cedric Ferry
3 min readFeb 5, 2022

In a previous article, we have seen how to add Google Assistant support to your App. Now it is time to get a step further and provide a beautiful user experience right into Google Assistant, so that the user don’t have to launch the app to interact with it. This will be done thanks to Slices.

What are Slices?

Slices are small card of UI, that Google Assistant display to provide a richer user experience. They can contains information pulled from APIs, as well as images and action buttons.

They are a way of interacting with your app without starting it full screen, the user experience is contextual to Google Assistant and conversational.

Slices are using basic UI blocks such as list, header, row, images, buttons… The developer can build the UI in a declarative way a bit like Jetpack Compose.

Slices offer a quick way to access feature of the app, so keep it simple.

Slices examples

Implementation

Declaring the Slice in Shortcuts.xml

Similarly to App Action, Slices need to be declared in shortcuts.xml Google offer a large set of pre-defined actions/captilities…

--

--