Question

I've installed an application on my Google Glasses but once I've closed it, I have to connect back to my PC to start it again.

How to register my app to the list of voice commands? E.g. "Ok Glass, show me the cube". So on the main screen, you start with "OK Glass" and then say a user-defined string (for example "show me the cube") and the application that is associated with this string will launch. I've seen this before by adding a few lines into the application manifest, but can't find it again. I'm aware that this might require a rooted Glass-device, but that is ok.

This discussion is related to this question, but does not give an answer.

Was it helpful?

Solution

There are a couple hacky ways to launch apps; I wrote a page describing them here.

As for voice triggering, there are two things you'll need to do.

First, add the following to your manifest as a child of your <activity> element that you want to launch:

<intent-filter>
    <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data android:name="com.google.android.glass.voice_trigger" android:resource="@string/voice_menu_trigger" />

and create a corresponding string in the res/string.xml.

Second, enable the native app voice build option on a rooted device (I describe all labs here and how to enable them here):

> adb shell setprop persist.lab.native_app_voice true

Note: This will only work if your Glass is in userdebug mode. Follow these instructions to put it into userdebug mode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top