What are Google Now Voice Actions?

The Google Voice Interactions API was recently added as part of Android Marshmallow. This is separate from the search-by-voice functionality provided by Google Voice Search last year. Google Voice Interactions allow developers the ability to communicate directly with their users. The concept is relatively simple: the user makes a request on Google Now ranging from “Take a picture” to “Play Thriller on myMusicApp”, and Android will open any app that is able to handle that specific request. If further interaction is necessary, the app can vocally communicate this information to the user with additional voice interactions.

tunein-interaction

What are the Benefits?

Google Voice Actions provides another way for users to interact with their apps; users who can’t be bothered to touch their screens can now verbally navigate through an app. The interface is fairly intuitive and interactive: an overlay for voice prompts covers part of the app screen. As the user provides information to the app, the app can dynamically update and adapt based on the user’s voice input. At the same time, users can still swipe and scroll through the screen during a voice interaction.

This is another excellent way to drive users to your app. As of now, 55% of teens and 41% of adults use Google Now.Contributing to this is Google Now’s success over Cortana and Siri as a verbal search engine. Many third party apps that have already implemented Google Voice Actions, including TripAdviser, Eat24, and TuneIn. Implementing Google Voice is another way for developers to maintain an extra edge over their competitors.

444190-digital-assistant-showdown

Google Now tops in sheer volume of questions successfully answered

What Voice Actions are available?

As a relatively new feature, voice actions are currently limited in number. Small enough that I can list them all right here:

This is a comprehensive list of System Voice Actions immediately available to developers. To add your own like “Lock the front door”, you would need to fill out the form here and have it approved by Google. Personally, I’d rather physically lock the door for peace of mind.

Show me some code!

There are 4 basic steps for setting up a full Google Voice Action Interaction:

  1. Update Gradle Build to Android M:
  2. Set up an Intent Filter in the Manifest to receive the voice intent from Google Now:For “Take a picture”:
  3. For Searching:

    As you can see both “voice” and “default” categories are required.

  4. Check for voice interaction:
  5. Alternatively, if your voice interaction includes a search query:

  6. Use Google’s Voice Interaction API
  7. For a full app Voice Actions App Demo, I recommend trying the two codelab apps that Google has on their website.

    How does the Google Voice Interactions API work?

    There are four steps to creating a Voice Interaction conversation:

    1. Retrieve the voice interactor
    2. Submit a request to the voice interactor
    3. Google handles the conversation
    4. Handle the callback (this is created within the request)

    The most important part for developers is the request; everything else is on Google’s end. A request is generally comprised of three things: a prompt to say to the user, expected responses, and a callback to handle the response.

    Here are a list of voice requests available to developers:

    What should I watch out for?

    There are several kinks in the Voice Actions system that still need to be ironed out. Below is a list of things I ran into while developing a Google Voice Action demo app for making reservations:

    If you’re interested in further reading, be sure to check out the below resources:

    Google Voice Action Demo
    Google Voice Action Demo
    Voice Action Guide
    Voice Action Developer API

    Share Button
    • Vincent Huang

      Thanks! If the system sees more than one viable application, it will provide the user a list of all possible apps. When a user selects the one they want it should begin to default to that specific app the next time the same voice command is used. You can see this here.

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