Skip to content Skip to sidebar Skip to footer

Implement Low-frequency Live Card In Google Glass

I try to implement low-frequency Live Card using the instruction provided in the GDK guides. I have a layout that I want to render and the LiveCard service class (that extends Serv

Solution 1:

Below is original answer, I have since made a reference project that takes the Google documentation and updates it for XE16 using the StopWatch project as a reference. Check the code and commit history to learn a lot more:

https://github.com/mscheel/GoogleGlass-XE16-LowFrequencyLiveCardBasketballScore

One way is to declare a voice trigger to start the service/livecard.

This is mentioned in this pattern explanation:

https://developers.google.com/glass/develop/patterns/ongoing-task

The technique is described here:

https://developers.google.com/glass/develop/gdk/starting-glassware#unlisted_commands

I tested it out with your code and it worked if the manifest has these items (modify for your package name of course) ... this first one goes inside the application tag:

<serviceandroid:name="com.example.lowfrequencylivecardexample.LiveCardService"android:enabled="true"android:exported="true"android:label="@string/app_name" ><intent-filter><actionandroid:name="com.google.android.glass.action.VOICE_TRIGGER" /></intent-filter><meta-dataandroid:name="com.google.android.glass.VoiceTrigger"android:resource="@xml/voice_trigger" /></service>

You also need:

<uses-permissionandroid:name="com.google.android.glass.permission.DEVELOPMENT" />

You will also need this file ... res/xml/voice_trigger.xml:

<?xml version="1.0" encoding="utf-8"?><triggerkeyword="basketball" />

I found the Timer project to be helpful in coming up with this, here is its manifest:

https://github.com/googleglass/gdk-timer-sample/blob/master/AndroidManifest.xml

Optionally you can make the home team the Celtics and the away team the Lakers. Larry Legend forever!

Post a Comment for "Implement Low-frequency Live Card In Google Glass"