1

I'm trying to use my application to use voice command like "ok, glass" -> power_ball(home screen) -> game1(cardview) -> game2(cardview) ->

I tried lot of examples but I only manage to get into one screen(home screen)....From a home screen how can I call another cardviews using voice command

Here what I have tried so far

manifest:

<activity
    android:name="info.androidhive.glassmenu.AboutActivity"
    android:label="@string/action_about" />
<intent-filter>
    <action android:name="com.google.android.glass.action.voice_trigger" />
    <action android:name="android.intent.action.MAIN" />
</intent-filter>
<meta-data
    android:name="com.google.android.glass.VoiceTrigger"
    android:resource="@xml/voice_trigger_start" />



<activity
    android:name="info.androidhive.glassmenu.SettingsActivity"
    android:label="@string/action_settings" />
<intent-filter>
    <action android:name="com.google.android.glass.action.voice_trigger" />
</intent-filter>
<meta-data
    android:name="com.google.android.glass.VoiceTrigger"
    android:resource="@xml/voice_trigger_start" />

String.xml

      <!-- App start voice command -->
        <string name="start_command">do</string>
        <string name="start_prompt1">check1</string>
        <string name="start_prompt1">check2</string>
        <string name="start_prompt1">check3</string>

Please advice what must I do from here.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
DaChavoh
  • 100
  • 1
  • 16

1 Answers1

0

Take a look if this is useful for you

I was able to get a menu on my screen when saying ok glass in the app itself with the menu options that I've entered in my xml file.

be sure to add <uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" /> to your manifest. It's for using custom commands that glass hasn't accepted yet.

TheUnknown
  • 50
  • 5
  • Thanks for reply, but I'm using a XE22, The code you gave me is using old version of Google Glass..... so I cant get help – DaChavoh Mar 10 '15 at 14:31
  • I'm using XE22 too. It worked perfectly fine for me. I didn't download the source code. I just started a fresh project and followed the tutorial so I would know exactly what was going on. So you shouldn't have any problems get that code working – TheUnknown Mar 10 '15 at 14:35
  • I GET AN ERROR HERE private GestureDetector createGestureDetector(Context context) { GestureDetector gestureDetector = new GestureDetector(context); //Create a base listener for generic gestures gestureDetector.setBaseListener( new GestureDetector.BaseListener() – DaChavoh Mar 10 '15 at 14:41
  • do you have the correct import? should be `import com.google.android.glass.touchpad.GestureDetector;` – TheUnknown Mar 10 '15 at 14:43
  • @DaChavoh here I put it up on github for you. is working perfectly fine on my glass https://github.com/MaikoHermans/TopFinderTut – TheUnknown Mar 11 '15 at 08:50