简体   繁体   English

从我的应用程序添加Google Assistant例程

[英]Add Google Assistant routines from my app

I'm trying to develop an interactive "allspeech-based" application and I have found some troubles. 我正在尝试开发交互式“基于allspeech的”应用程序,但发现了一些麻烦。

I would be able to do every task of my app without the touch input, only the voice one. 我将能够完成我的应用程序的每一项任务,而无需触摸输入,只需语音即可。

So, my idea was to use Google Assitant to open my app, and then execute tasks with Activities "allspeech-based". 因此,我的想法是使用Google助理打开我的应用程序,然后使用“基于allspeech的”活动执行任务。 My only problem is open my app with a custom phrase like "Hello myApp". 我唯一的问题是使用诸如“ Hello myApp”之类的自定义短语打开我的应用。

I've noticed that Google only permit to define in Manifest in which developer can set predefined method like SEARCH_ACTION (I have to say "Serch cats in myAPP..."), ... and not custom action! 我注意到,Google只允许在Manifest中定义,开发人员可以在其中定义预定义的方法,例如SEARCH_ACTION(我必须说“ myAPP中的猫猫...”),而不是自定义操作!

Then I had an idea: to resolve this I can define a new routine in my Google Assistant where Command is "Hello myApp" and action is "Open myApp", and it works! 然后我有了一个主意:要解决此问题,我可以在Google助手中定义一个新例程,其中Command为“ Hello myApp”,操作为“ Open myApp”,并且可以正常工作!

But I don't want to force my users to add a new tourine in their Assistant, I want to do it from my app automatically at the first opening of my app (throught an Intent and a startActivity or something similar idk). 但是我不想强迫用户在其助手中添加新的鸟嘌呤,我想在我的应用程序首次打开时(通过Intent和startActivity或类似的idk)从我的应用程序自动执行此操作。

My question is : How can I do? 我的问题是 :我该怎么办? Which Intent I have to invoke? 我必须调用哪个意图? With which extras? 有哪些附加功能? Is it possible? 可能吗?

Please answer, thank you. 请回答,谢谢。

没有这样的意图可以直接创建新的例程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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