Google Assistant SDK to integrate it in an app
Asked Answered
G

3

22

Is it possible to integrate the google assistant in an android app?

I couldn't find any information about it online.

I know today Google released the Assistant SDK but they don't mention any android support even in their Android Developers Blog post

It would be useful to ask for something your app can offer if installed.

For example:

"ok google, find a Star Wars blu ray on amazon"

and it would launch the amazon shopping app and look for it.

Is it possible to implement something like this within an app with this released SDK?

Guendolen answered 27/4, 2017 at 18:45 Comment(0)
V
10

Your example doesn't illustrate embedding the Assistant in your own app - it sounds like it illustrates using the Assistant to start your app.

The former would be supported with this SDK, the latter... not really.

You can embed the newly announced SDK into your apps by building a gRPC library for Android. See https://developers.google.com/assistant/sdk/prototype/getting-started-other-platforms/integrate for the overview information for the Assistant SDK and http://www.grpc.io/docs/quickstart/android.html for getting started with gRPC for Android.

Vander answered 27/4, 2017 at 19:49 Comment(2)
Thanks for the answer, Yes actually I meant to use the assistant to launch the app if installed on the device obviously. Perhaps with a future API...Guendolen
@Guendolen like doing a custom Android Launcher that's using the Google Assistant SDK ? It should be possible today, the only caveat is that you'll currently need a side channel for your AoG to notify back the Android app about which intent to fire.Delorsedelos
S
4

Google assistant is build for actions, so if you want to build a conversation, you need to use another api, like api.ai. Also you can look here.

Seamanship answered 27/4, 2017 at 19:49 Comment(1)
Does the answers here still apply. I wanted to integrate my application with google assistant like when I say 'Hey Google launch myAPP' and when the application is launched, if I ask it to launch a feature from the app say go to student enrollment it should be able to launch the same or if I say launch home it should go to home. Is this feasible at all?Katowice
M
0

Google launched App Actions, currently in developer preview. With App Actions you can have an Assistant Action to deep link into your app. The full details are at https://developers.google.com/assistant/app/get-started.

The short version is:

  1. Choose one of the supported BIIs (built-in intents), for example actions.intent.OPEN_APP_FEATURE.
  2. Create an actions.xml file according to the schema and link to it from the AndroidManifest.xml.
  3. Map the built-in intent to your activity in the actions.xml file you created:
<actions>
    <action intentName="actions.intent.OPEN_APP_FEATURE">
        <fulfillment urlTemplate="exampleapp://open{?appfeature}">
            <parameter-mapping intentParameter="feature" urlParameter="appfeature" />
        </fulfillment>
    </action>
</actions>

Your activity should then be available when asking the Assistant for queries as specified in the examples on the built-in intent's page.

Mesne answered 13/7, 2020 at 17:21 Comment(1)
Hi Yigal, I integrate the same intent but my fulfillment url is action.myappName.com/start{?featureName} this. i deployed my app on google play store too but when ever i am saying to google assistant "Open myAppName app for featureName". Google Assistant suggest only my app but never open it for that action. Please help me. i waste my lots of time on it. Where i am doing wrong??Selden

© 2022 - 2024 — McMap. All rights reserved.