[英]Google Assistant Actions
I am trying to use the Google Assistant to launch an activity of my Android app with a specific parameter.我正在尝试使用 Google Assistant 来启动我的 Android 应用程序的活动,该应用程序具有特定参数。 I have read this:
我读过这个:
https://codelabs.developers.google.com/codelabs/actions-1/#0 https://developers.google.com/assistant/app/action-schema https://developers.google.com/assistant/app/get-started
https://codelabs.developers.google.com/codelabs/actions-1/#0 https://developers.google.com/assistant/app/action-schema https://developers.google.com/assistant/app /开始
But I am confused, completely lost.但我很困惑,完全迷失了。 From my point of view, everything looks messy and confused.
从我的角度来看,一切看起来都很混乱和混乱。
In the Actions Console I have created one Action Project called "Actions Project for my app".在操作控制台中,我创建了一个名为“我的应用的操作项目”的操作项目。 Then I went to the DialogFlow console and modified the Default Welcome Intent and created some other intent.
然后我进入 DialogFlow 控制台并修改了默认欢迎意图并创建了一些其他意图。 Both were tested using the testing option "See how it works in Google Assistant."
两者都使用测试选项“查看它在 Google 助理中的工作方式”进行了测试。 It worked well doing those testings.
在进行这些测试时效果很好。
Then, in another site I read that I have to create an Action.xml file in my app project in Android studio.然后,在另一个站点中,我读到我必须在 Android 工作室的应用程序项目中创建一个 Action.xml 文件。 But how do I have to do that?
但是我该怎么做呢? Do I have to "export" my project "Actions Project for my app" to some xml file?
我是否必须将我的项目“我的应用程序的操作项目”“导出”到某个 xml 文件? I think that documentation is not enough for clumsy people like me.
我认为对于像我这样笨拙的人来说,文档是不够的。 I don't really know the next step.
我真的不知道下一步。 I am really struggling with this.
我真的很挣扎。
Basically I want the assistant to let the user say something, then pass that information to my app, do somework and then execute an activity to do something.基本上我希望助手让用户说些什么,然后将该信息传递给我的应用程序,做一些工作,然后执行一个活动来做一些事情。 For example, if we are talking about MyCookingApp I want this:
例如,如果我们在谈论 MyCookingApp 我想要这个:
User: Ok Google, talk to MyCookingApp
Assistant: Welcome to MyCookingApp, what do you want to cook?
User: Pizza
Assistant should open my app with the parameter "Pizza".助手应该使用参数“Pizza”打开我的应用程序。 My app should display an activity with a pizza image and the recepie for it.
我的应用程序应该显示一个带有比萨图像和它的接收器的活动。
Is all this possible?这一切可能吗?
Connecting your serverside Action to your Android app is not directly feasible.将服务器端 Action 连接到 Android 应用程序并不直接可行。 Actions on Google is available on a variety of surfaces beyond Android, so you can't necessarily expect the Action to immediately launch your app.
Actions on Google 可在 Android 之外的各种平台上使用,因此您不一定指望 Action 会立即启动您的应用程序。 However, there are a few ways to get the behavior that you want:
但是,有几种方法可以获得您想要的行为:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.