我希望能够通过Google助手的语音命令启动我的Android应用程序中的一些功能(“启动”,“停止”)。
- 要能够从Google助手启动这些功能,下一步是什么?
- 该开放应用程序功能支持哪些自然语言查询?
我已将 actions.intent.OPEN_APP_FEATURE
集成到我的应用程序中,并通过Android Studio中的App Actions测试工具成功测试过。
我的 actions.xml
:
<?xml version="1.0" encoding="utf-8"?>
<actions>
<action intentName="actions.intent.OPEN_APP_FEATURE">
<fulfillment urlTemplate="http://www.my-app.com/{?featureName}">
<parameter-mapping
intentParameter="feature"
urlParameter="featureName" />
</fulfillment>
<parameter name="feature">
<entity-set-reference entitySetId="FeatureEntitySet" />
</parameter>
</action>
<entity-set entitySetId="FeatureEntitySet">
<entity
name="@string/start_capture"
identifier="START" />
<entity
name="@string/stop_capture"
identifier="STOP" />
</entity-set>
</actions>
当我问Google助手类似“从我的应用程序打开起始页”之类的问题时,我期望得到与通过App Actions测试工具进行测试时相同的行为(打开应用程序的特定功能),但是Google助手提供了通用的Web结果。