Code samples

The following samples are available to help you build apps for Glass Enterprise Edition 2.

See Samples on GitHub

Card sample

The following sample demonstrates how to build a basic UI:

Sample text card UI Sample column card UI Sample menu UI

See the Card Sample

Camera2 sample

The following sample demonstrates how to take photos and videos with the Camera2 API:

Take picture Record video Video recording

See the Camera2 Sample

The following sample demonstrates how to browse and delete photos and videos:

Gallery images Full screen image Delete menu option

See the Gallery Sample

QR code scanner sample

The following sample demonstrates how to scan QR codes with the camera. It uses CameraX API and ZXing library to do so.

Gallery images Full screen image Delete menu option

See the QR Code Scanner Sample

Voice Recognition sample

The following sample app demonstrates the built-in voice recognition functionality.

Voice Recogntion app main screen Voice Recogntion app capture voice screen Voice Recogntion app main screen with results

See the Voice Recognition Sample

Notes sample

The following sample app demonstrates the built-in voice commands functionality and how to use it with the built-in voice recognition functionality.

Voice Recogntion app main screen Voice Recogntion app capture voice screen Voice Recogntion app main screen with results

See the Notes Sample

Voice commands reloading sample

The following sample app demonstrates how to reload voice commands and how to enable debug mode for voice commands.

Voice Recogntion app main screen Voice Recogntion app capture voice screen Voice Recogntion app main screen with results

See the Voice Commands Reloading Sample

Gesture detector sample

Basic navigation on Glass Enterprise Edition 2 device consists of detecting and responding to gesture events on the touchpad. Inputs and sensors page contains more information about it. Review this sample for implementation details.

See the Gesture Detector Sample

WebRTC sample

An example call center application that showcases video conferencing using WebRTC

See the WebRTC Sample