Voice Input Intents

Most applications require the user to input some form of text, such as when typing their username and password during login. We recommend adding the hf_text_dictation directive within the Android content description field of the desired text components. For more information on this method, please refer to our WearML Embedded API documentation.

If this solution does not work for your use case, refer to the steps outlined in this article below.

The best method will depend on the situation, and an application may use both methods for different types of inputs. For example the keyboard is best when entering entering an e-mail address while dictation would be better suited to typing out e-mail messages.

Dictation

Starts a new dictation activity for the user to enter some text using the dictation engine.

Intent

com.realwear.wearhf.intent.action.DICTATION

Extras

ExtraTypeDescription
com.realwear.wearhf.intent.extra.SOURCE_PACKAGEStringThe package ID for your app.

This is required as the result is passed back to this package ID.

Response Intent

When dictation is complete WearHF will send the dictation response back to your application using the following:

Dictation Successful

com.realwear.wearhf.intent.action.DICTATION_RESULT

Extras

ExtraTypeDescription
com.realwear.wearhf.intent.extra.TEXTStringThe dictation result

Dictation Error

com.realwear.wearhf.intent.action.DICTATION_ERROR

Extras

None.

Example

For an example of how to use dictation, see our developer example.