简体   繁体   中英

Google Assistant SDK to integrate it in an app

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?

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.

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM