Use Google Assistant to directly talk to my Android app and execute a very simple task

一世执手 提交于 2019-11-29 05:44:08

问题


I am working on a project to integrate the Google Assistant with an existing Android app. The requirements are simple. Assuming my app is named TestApp and I want it to just change the background color of the app home page, I want to be able to say,

"Hey Google, Change background to black on TestApp".

I was given links to ActionsSDK, but looking into it, I see that it is only a stand-alone app that extends Google Assistant and has nothing to do with android itself.

The closest API I found that does what I need is the Voice Interactions. This is very similar to what I need done but it only allows preset voice triggers such as "call this person..." or "set alarm at...", but cannot do "change background..." like in in my example. According to this link, custom voice actions aren't allowed.

So my question is, is it possible to directly interact with my app and have it do a very simple task?

Thanks


回答1:


You may want to connect an Android app property with your Actions project to sell your digital goods in the Play store. Implement digital transactions to sell your Play store items as part of a conversation with your Action.

To connect an Android app with your Actions console project, you will first need to connect a website to your project. Follow the instructions provided above in Connecting a website.

Once you've connected a website, under Android app, click the Connect App button and follow the instructions shown. Once you have completed the instructions over in the Play console, it may take up to 24hrs before the connected Android app is reflected in the Actions console. Try this in Action on google




回答2:


Right now there is no way to do communication between Android App and Google Assistant. If your GA is built upon Dialogflow API (specifically not using action-on-google), then you can use Dialogflow Android client in your Android App to communicate with Dialogflow Agent.




回答3:


I wrote an app for my own use to brighten the screen when I was in bright sunshine and could not see the screen by asking the assistant to launch the app. Then on launch I executed code to make the change. A cheesy work-around I know :-)




回答4:


you can try using this

[1]: https://docs.slanglabs.in/slang/

This will allow you to perform several actions through voice inside your app. You can use the console to add actions and utterances and there are some sample apps which might help you.

I have used it in a lot of my apps. Feel free to reach out in case you need help, good luck!



来源:https://stackoverflow.com/questions/47479510/use-google-assistant-to-directly-talk-to-my-android-app-and-execute-a-very-simpl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!