Saturday, 12 August 2017

android voice action and voice interation

First thing first, here is the link you can get all information and example code to run:

https://developers.google.com/voice-actions/

Then, basic concepts:

android voice action is the thing you can ask android to do "things" for you. To ask android to do "things" for you, you just need to tell android what to do after "ok google" . (you need to click the small microphone button on google app.)

However, android cannot do anything you ask. it can only do below things (system actions, google stopped to accept customiszed action.):

https://developers.google.com/voice-actions/system/#system_actions_reference

Which means you can use voice action to start your app and start your app with parameters. if you want to just start your app, you don't need do anything, users can do : "ok good, start xxx" -- xxx is your app name. to start your app with parameters you need to use the search action:  https://developer.android.com/guide/components/intents-common.html#SearchOnApp

you need to change your manifast to tell the system you will accept parameters, and you need to get the params from the intent and deal with it. Users need to do : "ok google, search for bra on xxx" xxx is your app name.


Voice interaction is the thing can enable your users to control your app by voice , e.g. they don't have to click the button, they can say "submit", Voice interaction can process the voice input and click the submit button for users.

However, this not always the case. Because you cannot get Voice Interaction capability if you launch your app just by clicking your app icon. The app need to be started by Voice Action. But not all Voice Actions can give your Voice Interaction capability. e.g. "open xxx" cannot, "search for aaa on xxx" neither.








No comments:

Post a comment