Create “ok glass” style menu, within glass app

后端 未结 4 1041
慢半拍i
慢半拍i 2021-02-02 03:08

I have just begun developing for Google Glass, and I knew the GDK if fairly new so this may not be possible yet, but here\'s what I\'m trying to to:

As with the \"make a

4条回答
  •  隐瞒了意图╮
    2021-02-02 03:53

    Are you asking if you can add a voice command to Glass that will trigger your app? If so - absolutely. This is, in fact, the suggested way to start an app on the GDK.

    See https://developers.google.com/glass/develop/gdk/input/voice#launching_glassware for the details, but basically you'll

    1. Add resources to res/values/strings.xml describing the trigger and prompt
    2. Create a resource in res/xml/.xml that uses the string value as the keyword and sets the input prompt
    3. Register an intent filter for the VOICE_TRIGGER action

    (As an aside, it appears that verbs are the best voice triggers to use - they flow more naturally with the "ok, glass" menu item.)

提交回复
热议问题