small medium large xlarge

Programming Google Glass (2nd edition): Build Great Glassware Apps with the Mirror API and GDK


Cover image for Programming Google Glass

Programming Google Glass (2nd edition)

Build Great Glassware Apps with the Mirror API and GDK


Google Glass is the wearable computer that everyone’s talking about—a head-mounted optical display with a camera that responds to voice and gesture controls. You can use the Mirror API and Glass Development Kit (GDK) to build custom Glassware for yourself and others, from social networks and geolocated maps to immersive video games and more. This new edition, with an all-new part covering the GDK, kick-starts your Glassware development by showing you how to write real-world functional applications that you can deploy and run. It’s the book to read for a shortcut to this new world.

The book is content complete. Google has terminated the Glass Explorer program. The book has been updated to reflect the current state of Glass development.

About this Title

Pages: 250
Published: 2015-02-13
Release: P1.0 (2015-02-13)
ISBN: 978-1-94122-218-8

This is your all-inclusive guidebook for programming Glassware. You’ll learn the nuances of the Mirror API and the recently released GDK as you build example applications: a restaurant finder, blogging app, Glass stats monitor, party animator, QR code reader, video game, and more.

You’ll jump right in with a fun application that leverages the power of the Mirror API web service, Google’s server-side interface for creating Glassware. You’ll deploy and support users with OAuth, managing their timelines with cards and menu items. You’ll create callable services for geolocation tracking, change notifications, and custom menu options. You’ll also learn some optical-display design basics.

In Part 2, new in this edition, you’ll learn how to program a more immersive experience using the GDK, Google’s extension to Android for Glass. You’ll populate the Glass timeline with static and live cards, where you can richly interact with the Glass hardware. You’ll create an animation application (with balloons!), and move onto more advanced apps using the camera and real-time rendering. You’ll learn how to hack and debug your Glass, and you’ll see how to turn existing applications into Glassware.

Be one of the first programmers of a technology that will only become more ubiquitous, advanced, and nuanced.

What You Need

You will need a Google Glass device and Java 1.6 or greater. An Android device, such as a smart phone or tablet, is also helpful, but not necessary.

Contents & Extracts


  • Wrapping Your Head Around Glass
    • Getting to Know Glass
    • Learning to Navigate
    • Glass Hardware
    • Glass Software
    • Wrap-Up
  • The Mirror API
    • The Google App Engine PaaS
      • Setting Up GAE
      • Making a Web App
      • Deploying to the Web
      • Fancy Templates
      • Wrap-Up
    • Authorizing Your Glassware
      • Activating Your Mirror API
      • A Short Primer on OAuth 2.0
      • Applying OAuth to Create Glassware
      • Wrap-Up
    • Building the Timeline
      • Mirror HTTP Requests
      • Timeline Items
      • Multicards: Bundles and Paginating
      • Menus
      • Cron Jobs
      • Wrap-Up
    • Tracking Movement and User Responses excerpt
      • Geolocation
      • Using Location
      • Subscriptions
      • Accepting Notifications
      • Custom Menu Items
      • Wrap-Up
    • Making Glass Social
      • Creating Contacts
      • Sharing Assets with Glassware
      • Getting and Setting Attachments
      • Wrap-Up
    • Designing for Glass
      • A Little UX
      • Design Layout
      • Look and Feel
      • Wireframes and Mock-Ups
      • Wrap-Up
    • Turning a Web App to Glassware
      • ChittrChattr App
      • Glassifying the Actions
      • The Mirror Code
      • Wrap-Up
  • Glass Development Kit
    • Introducing the GDK
      • Choosing the GDK by Use-Case
      • Setup a GDK Dev Environment
      • An Android Primer
      • Wrap-Up
    • An Android Introduction on Glass
      • Generating a Simple Android App
      • Basic Android SDK+GDK
      • The Activity Component
      • Service, Broadcast Receiver, and Content Provider
      • Wrap-Up
    • Live Cards excerpt
      • Planning a Live Card Project
      • Implementing a Live Card Glassware
      • A Card Menu
      • Launching an App with Voice
      • Updating RemoteViews
      • Wrap-Up
    • Advanced Rendering and Navigation
      • High Frequency Rendering
      • Scrolling Through Multiple Cards
      • Gestures and Sound Effects
      • Launching the Balloon Count Scroller from the Menu
      • Taking Photos with the Camera
      • Wrap-Up
    • Voice and Video Immersions
      • An Immersion App
      • A Speech-to-Text Caption App
      • Sending Data to a Web Service
      • Adding Geolocation
      • A QR Code Reading Camera
      • Wrap-Up
    • Creating an Immersive Game excerpt
      • Start The Game with a Splash Screen
      • Gesture and Sensor Inputs
      • Rendering Visuals and Playing Audio
      • Game Logic
      • Wrap-Up
    • Preparing For the Real World
    • Turning an Android App to Glassware
  • Author

    Eric Redmond has worked with Fortune 500 companies, governments, and many start-ups. He is a programmer, illustrator, international speaker, Glass Explorer, and organizer of Google Glass Portland.