Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
JavaEE Guides
Setting Up Voice Commands

Setting Up Voice Commands

Voice commands are global commands available anywhere on the head unit to users of your app. Once the user has opened your SDL app (i.e. your SDL app has left the HMI state of NONE) they have access to the voice commands you have setup. Your app will be notified when a voice command has been triggered even if the SDL app has been backgrounded.


The head unit manufacturer will determine how these voice commands are triggered, and some head units will not support voice commands.

You have the ability to create voice command shortcuts to your Main Menu cells which we highly recommended that you implement. Global voice commands should be created for functions that you wish to make available as voice commands that are not available as menu cells. We recommend creating global voice commands for common actions such as the actions performed by your Soft Buttons.

Creating Voice Commands

To create voice commands, you simply create and set VoiceCommand objects to the voiceCommands List on the screen manager.

VoiceCommand voiceCommand = new VoiceCommand(Collections.singletonList("Command One"), new VoiceCommandSelectionListener() {
    public void onVoiceCommandSelected() {
        // Handle the VoiceCommand's Selection


Deleting Voice Commands

To delete previously set voice commands, you just have to set an empty List to the voiceCommands List on the screen manager.


Setting voice command strings composed only of whitespace characters will be considered invalid (e.g. " ") and your request will be aborted by the module.

Using RPCs

If you wish to do this without the aid of the screen manager, you can create AddCommand objects without the menuParams parameter to create global voice commands.

View on GitHub.com
Previous Section Next Section