# Lessons learned from Google Assistant and App Actions on Android

DevFeed: [Lessons learned from Google Assistant and App Actions on Android](<https://devfeed.tech/articles/lessons-learned-from-google-assistant-and-app-actions-on-android-25939.md>)

Original publisher: [Read original article](<https://juliensalvi.medium.com/lessons-learned-from-google-assistant-and-app-actions-on-android-c59c2dc60bd5?source=rss-cbfc736ddcd3------2>)

Author: Julien Salvi

Published: 2021-06-08T13:48:11Z

Content type: tutorial

Language: en

Sources: [Julien Salvi](<https://devfeed.tech/sources/stories-by-julien-salvi-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [experience report](<https://devfeed.tech/topics/experience-report.md>), [App Indexing](<https://devfeed.tech/topics/app-indexing.md>), [deeplinks](<https://devfeed.tech/topics/deeplinks.md>), [Google](<https://devfeed.tech/topics/google.md>), [To-Do](<https://devfeed.tech/topics/todo.md>)

Tags: [actions](<https://devfeed.tech/tags/actions.md>), [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [google-assistant](<https://devfeed.tech/tags/google-assistant.md>), [slices](<https://devfeed.tech/tags/slices.md>), [voice-assistant](<https://devfeed.tech/tags/voice-assistant.md>)

## AI overview

Aircall's hackathon implementation used Google Assistant App Actions to start calls and Android Slices to show a user's to-do list in Assistant. Call actions use the CREATE_CALL built-in intent and pass a contact or phone number through a deeplink; the list uses GET_ITEM_LIST with a Slice fulfillment and a deeplink fallback. Slice providers should return quickly: the excerpt says to avoid heavy or network work in provider callbacks, load data elsewhere, then refresh the slice. Testing required the Android Studio App Actions Test Tool, matching Google accounts in Android Studio and on the device, Assistant enabled, and an app uploaded to Play Console, including each flavor with a distinct application ID. The author reports that testing was cumbersome and that Assistant struggled with their pronunciation; Siri understood it better. The supplied text is an excerpt, so it may not cover the full article.

## Source excerpt

Photo by Soundtrap on Unsplash My company, Aircall, recently organized a hackathon to unleash our tech ideas for one and a half day. With the iOS folks, we decided to experiment voice interactions with Siri and Google Assistant in order to call a contact or show a specific data outside the application's scope with Android Slices. In this article, I'll show what we learned from Google Assistant and how we used App Actions to bring voice controls to our app. Identifying the features First, we wanted to identify the features we can bring to our application, thanks to Google Assistant. Our main app is a VoIP phone for businesses, so the first idea was to call someone from your contacts with the voice like "Ok Google, call John Doe on Aircall". Google Assistant offers the App Actions to achieve such goals on Android. Then, we thought about bringing relevant data to our users outside the application using voice actions. To do so, we will use the Android Slices to bring what's on the to-do of a user in Google Assistant with a command like the following: "Ok Google, show my to-do list on Aircall". Let's see how we implemented these two features in the Aircall app. Let's play with App Actions and Slices First, let's add the dependencies to the project. We need to add the Firebase Core and the App Indexing libraries to make the (deep)link between Google Assistant and our app. To display interactive cards on Google Assistant, we are going to use the AndroidX Slice library. Check for the latest updates of the Slice library here. Gradle dependenciesMake a call with App Actions To interact with our application, we need to define some actions in an actions.xml file located in the xml folder of the resources. Each action is associated with a built-in intent (BII) which model some of the common ways that users express tasks. App Actions provides over 60+ BIIs. Once the file is created, we are going to create the dedicated action to call a number or a contact, thanks to the intent ac