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?

Daniele
  • 4,163
  • 7
  • 44
  • 95

3 Answers3

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.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • 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... – Daniele Apr 28 '17 at 07:40
  • 2
    @Daniele 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](https://developers.google.com/assistant/sdk/prototype/device-control/actions-on-google) for your AoG to notify back the Android app about which intent to fire. – proppy May 01 '17 at 18:27
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.

Cătălin Florescu
  • 5,012
  • 1
  • 25
  • 36
  • 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? – Ajay Srikanth May 29 '19 at 13:33
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.

Egal
  • 1,374
  • 12
  • 22
  • Hi Yigal, I integrate the same intent but my fulfillment url is https://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?? – Ashik Abbas Jul 14 '20 at 06:23