0

I want to build an apk(Named commander) to use Google assistant(SDK), the feature designed below: 1:control some device, for example. Just say"Ok google, set the brightness to 100" or "Ok google, take a picture now."

2:Use default google assistant's feature, for example. "Ok google, call lucy" or "Ok google, send a message to Lucy to ask her to have breakfast"

3:Send command directly without say "Ok google, let's talk to commander"

My question is that, is Actions on Google just build an app which is plugged in google assistant app? Could user call my own app to do something when receive the actions on google.

For example: User say "ok google, call lucy" this command will deliver to google own assistant to handle it, and when user say "ok google, set the brightness to 100" will response an action to my owner app with parameter(100) in a intent?

Could I implement it ?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
FuBao Nie
  • 11
  • 1
  • 5
  • Please see here - https://github.com/androidthings/sample-googleassistant – Dnyaneshwar Panchal Apr 20 '18 at 09:46
  • Thank you sir, yes and I have run this sample project on my phone successfully, I can use the command "turn on/off", but this is action which is defined by Google, and I build some action in https://console.actions.google.com/ , but I need to say "talk to XXX" to enable the app, what should I do to enable my customized action by "ok google, take a picture". And even if use "talk to XXX" to enter actions on google, but I still cannot get action by the assistant sample, either. Could you give me some suggestions? Thank you~ – FuBao Nie Apr 20 '18 at 11:58

1 Answers1

0

As a commenter stated, you can modify the Android Things sample for the Google Assistant SDK so that it runs on phones.

The sample does not include hotword capability. You'll launch the regular Google Assistant and not your implementation. If you want your implementation to handle particular commands, you should add device actions.

If you register commands like "Call $name" or "Set the brightness to $percent", you can handle that with your own implementation like your own VoIP service or change the brightness.

Nick Felker
  • 11,536
  • 1
  • 21
  • 35
  • Thanks Nick, and your reply is useful. And I have a new question want to ask your help. I want to use "call $name", but I don't know which pattern type should be selected. Either SchemaOrg_Person, or SchemaOrg_Text doesn't match completly. For example, I said "Call Lucy", none of the pattern can be matched. – FuBao Nie Apr 25 '18 at 09:41
  • Using `$SchemaOrg_Text` will not work at the moment. You may want to look at using `$SchemaOrg_Person:given-name` for the person's first name – Nick Felker Apr 25 '18 at 15:59
  • $SchemaOrg_Person:given-name cannot match Lucy, James, but can recognise Yao Ming, so I cannot understand how the $Schema_xxx works? – FuBao Nie Apr 26 '18 at 02:08