Thursday, January 30, 2014

How to use ok command in google glass application

As time frame of google glass (start on google glass) we are getting "ok glass", if we wish to apply same command over our own application,

Then, you have to update couple of thing in manifest file like -


<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/my_voice_trigger" />
 <uses-permission android:name="android.permission.RECORD_AUDIO"/>
<trigger keyword="@string/glass_voice_trigger">
    <input prompt="@string/glass_voice_prompt" />
</trigger>



Google Glass comes with a handful of Voice Commands right out of the box. With Glass you can do a lot of things like a Google search, take a picture, record a video, send messages, make phone calls, and even start a Google+ Hangout. To get started, all you have to do is say “ok glass” followed by the appropriate voice command.
To get started, make sure your Glass display is active. If the Glass display is not ready to go, you can wake Glass up by touching the touchpad or using Head Wake by lifting your head. After Glass is ready, saying “ok glass” will display all voice commands on your display. To scroll through the list, you can tilt your head or swipe the touchpad back and forth. If this isn’t ideal, without speaking you can open the list of voice command by double tapping the touchpad while on the Home screen.

Google Glass Voice Commands

ok glass, google
To search using the best search engine in the world, simply say “ok glass, google ‘William Shatner Bacon number’”, for example. To search Google even quicker, just long press the touchpad and say your search query, even without the display being active.
ok glass, take a picture
Besides using the camera button to take a picture, you can do it completely hands free by saying “ok glass, take a picture”. After the picture is taken, you’ll see a brief preview before being saved to your timeline. Don’t forget to ask someone for consent before taking their picture.
ok glass, record a video
Want to record hands free video? No problem, just say “okay glass, record a video” and you’ll see a live preview of your recording with a counter. By default, videos only record for 10 seconds. To record a video longer than 10 seconds, while recording, tap your touchpad and select Extend video. To stop the extended recording, tap the touchpad again and swipe to select Stop recording. You can also use the camera button to record a video by holding it down for one second. Don’t forget to ask someone for consent before taking their picture.
ok glass, get directions to
Need directions? You’ll first need to enable this feature through the MyGlass app for Android.  Next, just say “ok glass, get  directions to ‘the nearest Chinese restaurant’” or wherever you want to go such as “1600 Amphitheatre Parkway, Mountain View, CA”. After your directions are found you can swipe through the listings and then tap upon the desired result. To stop navigating or switch to walking or biking directions, tap the touchpad.
ok glass, send a message to
To send voice to text translated messages with Glass, simply say “ok glass, send a message to Derek Ross” or whomever your contact is followed by your message. For example: “ok glass, send a message Derek Ross you’re awesome”. Messages are sent by email unless you have the MyGlass application installed. If the app is installed and the contact has a phone number, an SMS message will be sent. You can add contacts to Glass through the MyGlass website or the MyGlass app.
ok glass, make a call to
To call someone through Glass, you’ll have to pair your device to your phone via Bluetooth. Once paired, just say “ok glass, make a call to Kate Upton” and if you’re lucky enough to have her number, Glass will make the call.
ok glass, hang out with
Thanks to Glass, others can see what you’re seeing anywhere in the world with a Google+ Hangout. To start one, simply say “ok glass, hang out with Sergey Brin” or “ok glass, hang out with Foodies” to Hangout with your Foodies Circle. Your Hangout is then posted on your Google+ stream for the appropriate person or Circle to see. Don’t forget to add your Google+ contacts via the MyGlass site or app before starting a Hangout.
For more information on the above Google Glass Voice Commands, head on over to the official Glass Support site.
Note - Information is collected from different different site and blog.
Welcome to give your feedback and question to write on.