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

Gallery 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

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