blog, google glass April 11, 2013 Michael Quoc No comments

The Building Blocks of Google Glass’ Mirror API: Cards, Menu Options, Share Entities and Subscriptions

For those interested in working the Google Glass’ Mirror API, here’s a summary of the key points from Timothy Jordan’s overview SXSW presentation of the Mirror API. In a nutshell, the Mirror API looks like many other REST APIs. Your app and Google Glass send information to each other via a REST architecture, using OAuth2.0 for authentication, JSON to encapsulate data, and standard POST, GET and PUT methods for sending, listing and updating information.

The Glass user experience is based on four central building blocks:

  • Cards: the basic UI unit where information and media can be displayed
  • Menu Options: actions the user can take with a card (like replying or sharing)
  • Share Entities: people or applications with which information with a card can be shared
  • Subscriptions: events that your app can asked to be notified about

Screens and notes from Timothy’s presentation are below.

Glass is based on your “Timeline” and “Cards” that live in that timeline.

Screen Shot 2013-04-10 at 3.48.35 PM

 

The user who is wearing Glass initiates a session with Glass by looking up. You can then issue voice commands or swipe your eyeglass earpiece in various directions to interact with the UI.

Screen Shot 2013-04-10 at 3.49.19 PM

Cards can be stacked into “Bundles” which the user can dive into to retrieve more cards relating to the first (cover) card.

Screen Shot 2013-04-10 at 3.49.37 PM

 

Your app can create a card using a POST.

Screen Shot 2013-04-10 at 3.55.05 PM

 

Cards can contain media.

Screen Shot 2013-04-10 at 3.55.11 PM

 

Cards can contain HTML.

Screen Shot 2013-04-10 at 3.55.19 PM

 

There are two ways to create a bundle. The first is to create multiple HTML pages for a single card, sort of like pagination.

Screen Shot 2013-04-10 at 3.55.30 PM

 

The second way to create a bundle is by tying multiple cards together with a bundleId.

Screen Shot 2013-04-10 at 3.56.37 PM

 

You can modify the content within a card using a PUT.

Screen Shot 2013-04-10 at 3.56.47 PM

 

You can list a single card, or the entire timeline with a GET.

Screen Shot 2013-04-10 at 3.57.10 PM

 

Within a card, you can also define Menu Options tied to functions, enabling the Glass user to interact with cards.

Screen Shot 2013-04-10 at 3.57.39 PM

 

Here’s an example of adding a standard READ_ALOUD menu option to a card.

Screen Shot 2013-04-10 at 3.58.58 PM

 

Here’s how to add a custom menu option called “love.”

Screen Shot 2013-04-10 at 3.59.14 PM

 

 

You can define Share Entities for your cards which give the user options for sharing content with friends on Google+ or through your app.

Screen Shot 2013-04-10 at 4.00.27 PM

 

Here’s an example of creating a Share Entity for example.com.

Screen Shot 2013-04-10 at 4.01.02 PM

 

Your app can subscribe to a user’s timeline via Subscriptions.

Screen Shot 2013-04-10 at 4.01.28 PM

 

Your app can subscribe to a user by sending credentials to Google.

Screen Shot 2013-04-10 at 4.02.03 PM

 

Once subscribed, your app can be notified, for example, if a user selects a menu option on a card from your app, or if a share entity is called.

Screen Shot 2013-04-10 at 4.03.09 PM

 

Here’s an example of a ping that Glass sends to example.com via a Subscription event tied to the user’s timeline.

Screen Shot 2013-04-10 at 4.02.08 PM

 

Finally, here are some best practices for developers for Glass, these are logical and pretty self-explanatory.

 

Screen Shot 2013-04-11 at 10.58.32 AM

Follow my blog with Bloglovin

Leave a Reply