Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

android - Glass GDk : Contextual voice commands without the "Ok Glass"

I have an application with a CardScrollView as activity.

Ok Glass => My App => Ok Glass => Next Page
                  Or  OK Glass => Previous Page

Would it be possible to skip the second "Ok Glass" ?

The best would be to let the Voice Command always activated but I don't know if it's possible.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I actually did this for my Glass app. Take a look here: https://github.com/RIVeR-Lab/google_glass_driver/tree/master/android/RobotManager/src/com/riverlab/robotmanager

You are going to be interested in the VoiceRecognitionThread, Vocabulary, and MessageListActivity.

The functionality you described is implemented in both MessageListActivity and VoiceRecognitionThread.

The vocabulary is just support for multi-layered commands. You only need to worry about it if you plan on using voice commands that could branch off to other commands. For example, in my application I was controlling a robot. Commands could look like "drive forward" "drive forward quickly" "drive forward now" or "drive forward quickly delay five". You can see examples in the xml files here: https://github.com/RIVeR-Lab/google_glass_driver/tree/master/test

Hope this helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...