Tag Archives: development

Google Glass – Adding your Own Voice Commands to Your Apps

Hey guys with the introduction of the Glass development Sneak Peek, I found the way to add your own voice command to trigger your app. This is for native Android Apps.

What you have to do is,

Step 1
inside the manifest file add these tags under the service which you wanted to trigger on your voice command.

<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” />

Step 2And you have to create a folder called xml inside res and add a xml file named as “voice_trigger_start.xml”

Step 3
Inside that add these lines

<?xml version=”1.0″ encoding=”utf-8″?>

<trigger keyword=”@string/its_me_amalan” />

Step 4
Open the values folder inside res folder and edit strings.xml, so it will look like this

<resources>
<string name=”app_name”>Amalan</string>
<string name=”its_me_amalan”>Hello Amalan</string>
<string name=”stop”>Stop</string>
</resources>

Now install the app into the google glass and say
OK GLASS Hello Amalan
And the app opens

I have used my name 😉 but you can try lots of other words.

Please install the latest  Glass Development KIT and tryout the samples, you can get more out of it 🙂

Get the Source here
gitHub-download-button

 

All What you need to know before start developing for Google Glass (Infographic)

google_glass_dev_kinvey

Ok then, In my next post we will see how to install Google Glass Software in our Android Phone without rooting the phone(So in future till we get a proper emulator we can use it)…!

Info graphic Image Source : http://readwrite.com/2013/05/30/everything-you-need-to-know-to-get-started-with-google-glass-development