How do I use Google assistant to trigger my application - android

I am trying to build a simple app which can be triggered by google assistant.
Like if the users say, "Hey Google, Open TestApp" or "Hey Google, perform xyz from TestApp".
What would be the best approach? Dialogflow?

Saying "Okay, Google - do [something] with [your app]" in order to open your app to fulfill a query is called a Google Voice Action and you can add these to your app quite easily. See the documentation here for full details. Keep in mind - for these to work, your app does need to be in the Play Store, uploaded as a beta at the very least.
The Google Assistant is a little bit different - it's more conversational and doesn't take the user directly to your app. Instead, it takes the user's input, looks for the appropriate app to handle the query, feeds the query to your app, and then returns the response, within Google Assistant itself. This is all about having a conversation with an app, from the Google Assistant, without actually opening up your app.

Related

How should I implement radio controls using Google Assistant?

My use case is the following:
the user is driving or he/she's somehow unable to use his smartphone with his/her hands. All the actions he/she can do are the following:
"hey goole,"
play playlist $playlistName
play $radioStation
play $podcastName of $podcastDate
pause
next radio station
previous radio station
I've seen a Google I/O '18 video where they presented App Actions (here a readable version of the presentation). One should basically create an action.xml file where the mapping between the sematic intent and the android intent is created. So, when the user says the "magic words" (semantic intent), the right (android) intent is invoked to fulfill the request.
My questions are:
How do I create a semantic intent using the Action Console/Dialogflow console? All I have seen is how to create a conversational app which is not what I need
Since on the developer guide is stated "Note: Developer preview coming soon!", am I missing something? Is there a way to do what I need using the Actions on Google console?
Note:
To get the Radio contents I use a third-party library
Unfortunately, direct invocation of the Google Assistant ("Hey Google, play Africa by Toto") is not currently available to third party developers.
However, you can use explicit invocation to trigger a Google Assistant action that could then send an HTTP request to a REST API that could communicate with your Android app.
The user can include an invocation phrase at the end of their invocation that will take them directly to the Actions on Google > Dialogflow > Firebase function they're requesting, like so:

Google Assistance integration with Android App

I want to integrate Google Assistant in my app. I am not just for launching the the app, also to operate on it like below:
App: Hi! What are you looking for?
User: T-shirts
App: What is the size?
User: 40
App: What is the color?
User: Any / Red and blue
App: Here is the T-shirts for you
User: Show order by Popularity
App: Here it is.
Is it possible to do so by Google Assistance? Is it possible to start any activity of my app with proper intent extra?
With Actions on Google as you will need to build a server side components to handle the voice/chat interaction. For an example of the voice interaction see: https://developers.google.com/actions/extending-the-assistant
As to actually starting an app from Google Assistant. I don't believe there is a direct way.
Alternatively that seems to be possible for a select set of voice commands through Google Search Voice Actions to reach your app.
Note that Google isn't taking any more requests for custom Voice Actions:
https://developers.google.com/voice-actions/custom-actions
And that the pages doesn't seem to have been updated since 2015 so I'm unclear what is still supported or not.
From what I can tell the only part of Google Search Voice Actions that may be still around in 2017 is the ability to incorporate app data into Google Search via
Firebase App Indexing

Start Google Assistant Voice interaction

I've seen the Voice Actions API and it describes how you can create your own voice interactions that can be started by Google Assistant using keywords. This enables the user to say Ok, Google and then your keywords. Google Assistant then forwards the interaction to your android app's activity.
I'd like to go the other direction. I want to use a built-in interaction that Google Assistant already handles, but I'd like to begin the interaction from inside my app (meaning I want to pass some data to Google Assistant, or at least launch it with it listening). Does anyone know if that is possible? Each time my app detects a certain trigger, I'd like to prompt Google Assistant to begin a specific interaction with the user without them first having to say "Ok, Google".
I could do something similar by beginning my own interaction using text to speech and the speech recognizer service, but the voice sounds and work flow are so much cleaner in Google Assistant so why re-invent the wheel.
Alternatively, if there was a way to use the same voice and voice recognition used by Google Assistant I could work with that.
Any ideas?
Since you asked your question, Google has launched a developer preview of the Google Assistant SDK that sounds like it does what you want (or can). Although intended for embedded devices, it will let your users open a voice channel to the Assistant without having to say "OK Google" and get a voice response back.
There are some issues still with triggering something inside your app itself, but it is possible now and expected to improve over time. Currently you'd have to issue the command to your app out of channel - so either by having your server-side Action send your app a GCM message or by taking other actions that your app could pick up.

Launch app with parameters with Google Now

It's possible with Google Now (with voice command) to open app with parameters?
Example:
I have an app that can controls an alarm, named "Alarmed"
Can I say:
"OK google , 'command' app" -> Then open app and pass data 'command' to the app "app".
Thanks!
Nope! Thats not available to all developers quite yet.
Google decides what goes in for some reason.
As you can see here from google.
And more recently.

Can I track what keywords lead users to find my app on Google Play?

I know I can add a referrer parameter to the Google Play URL to track downloads from a specific source, but can I track which keyword searches users used to find my app on Google Play?
Before Google Play, i.e Android Market, I was receiving in the referrer all the relevant information to help me understood how my app was found.
It could have been keywords, tops, similar applications, etc.
It was really, really useful.
Since Google Play, I do not receive anything anymore. The only referrers I get are the one I set manualy when I do some campaigns. I spent a lot of time trying to understand why, but it looks like Google Play just doesn't send this information anymore. Doesn't make sense to me, however.
However, you'll get keywords of how users found your application on Google Play from Google search engine (if they hit "Install on my phone" button).
Referrer example utm_source=google&utm_medium=organic&utm_term=my+keyword
(doesn't work if user is using https Google search)
Not exactly, because your app is found by keywords defined by YOU.
-> If you're selling navigation based app, you may enter "navigation". Therefore it appears under keyword navigation and in that case, the result would be relevant.
If they open something related to app that is related to your app, will you be interested in the first keyword that could have been something totally different?
-> If there's an app with keyword "children", they open it and Google Play then recommends something else with children, they open it. Then, this second app, having also keyword children could have a tag "navigation". Then Google Play could recommend YOUR app. I don't believe that tag "children" would be your concern :-)

Categories

Resources