Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch app on Google Glass with Voice Command [closed]

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.

like image 597
Alexander Pacha Avatar asked Oct 22 '22 01:10

Alexander Pacha


1 Answers

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.

like image 147
Dany Joumaa Avatar answered Nov 01 '22 12:11

Dany Joumaa