developing for google glass

61
Developing for Google Glass February 4 th 2014 Mark Billinghurst, Gun Lee HIT Lab NZ University of Canterbury

Upload: mark-billinghurst

Post on 08-Sep-2014

9.007 views

Category:

Technology


1 download

DESCRIPTION

Presentation given by Mark Billinghurst and Gun Lee on how to develop for Google Glass. Given on February 4th in Christchurch New Zealand.

TRANSCRIPT

Page 1: Developing for Google Glass

Developing for Google Glass

February 4th 2014

Mark Billinghurst, Gun Lee HIT Lab NZ

University of Canterbury

Page 2: Developing for Google Glass

The Glass Class – Feb 17th – 21st

  Intensive Glass Course   See http://arforglass.org/

Page 3: Developing for Google Glass

Overview   Introduction to Glass   Concept Design Non-programmers   Rapid Prototyping Simple programming   Mirror API - Server Development   Native Applications - Java/Android Developers   More Resources

Page 4: Developing for Google Glass

Introduction

Page 5: Developing for Google Glass

Google Glass

Page 6: Developing for Google Glass
Page 7: Developing for Google Glass
Page 8: Developing for Google Glass

View Through Google Glass

Always available peripheral information display Combining computing, communications and content capture

Page 9: Developing for Google Glass

User Interface

  dfasdf

Page 10: Developing for Google Glass

  Hardware  CPU TI OMAP 4430 – 1 Ghz   16 GB SanDisk Flash,1 GB Ram   570mAh Battery

  Input   5 mp camera, 720p recording, microphone  GPS, InvenSense MPU-9150 inertial sensor

  Output   Bone conducting speaker   640x360 micro-projector display

Page 11: Developing for Google Glass

User Experience   Truly Wearable Computing

  Less than 46 ounces

  Hands-free Information Access   Voice interaction, Ego-vision camera

  Intuitive User Interface   Touch, Gesture, Speech, Head Motion

  Access to all Google Services   Map, Search, Location, Messaging, Email, etc

Page 12: Developing for Google Glass

  https://glass.google.com/glassware Glassware Applications

Page 13: Developing for Google Glass

Concept Design Tools

Page 14: Developing for Google Glass

Glass Sim – http://glasssim.com/

  Simulate the view through Google Glass   Multiple card templates

Page 15: Developing for Google Glass

Glass UI Templates

  Google Glass PSD Templates   http://glass-ui.com/   http://dsky9.com/glassfaq/the-google-glass-psd-template/

  UXPin Wireframing Tool   http://uxpin.com/

Page 16: Developing for Google Glass

Glass Application Storyboard

  http://dsky9.com/glassfaq/google-glass-storyboard-template-download/

Page 17: Developing for Google Glass

Glass Application Flow

Page 18: Developing for Google Glass

Rapid Prototyping

Page 19: Developing for Google Glass

Processing   Programming tool for Artists/Designers

  http://processing.org   Easy to code, Free, Open source, Java based   2D, 3D, audio/video support

  Processing For Android   http://wiki.processing.org/w/Android  Generates Glass Ready .apk file

Page 20: Developing for Google Glass
Page 21: Developing for Google Glass

Development Environment

Page 22: Developing for Google Glass

Hello World //called initially at the start of the Processing sketch!void setup() {! size(640, 360);! background(0);!} !!//called every frame to draw output!void draw() {! background(0);! //draw a white text string showing Hello World! fill(255);! text("Hello World", 50, 50);!}!

Page 23: Developing for Google Glass

Demo

Page 24: Developing for Google Glass

Hello World Image PImage img; // Create an image variable!!void setup() {! size(640, 360);! //load the ok glass home screen image! img = loadImage("okGlass.jpg"); // Load the image into the program !}!!void draw() {! // Displays the image at its actual size at point (0,0)! image(img, 0, 0);!}!

Page 25: Developing for Google Glass

Demo

Page 26: Developing for Google Glass

Touch Pad Input   Tap recognized as DPAD input

!void keyPressed() {!!if (key == CODED){!! !if (keyCode == DPAD) {!

!// Do something ..!

  Java code to capture rich motion events   import android.view.MotionEvent;!

Page 27: Developing for Google Glass

Motion Event //Glass Touch Events - reads from touch pad!public boolean dispatchGenericMotionEvent(MotionEvent event) {! float x = event.getX(); // get x/y coords ! float y = event.getY();! int action = event.getActionMasked(); // get code for action! ! switch (action) { // let us know which action code shows up! !case MotionEvent.ACTION_DOWN:! ! !touchEvent = "DOWN";! ! !fingerTouch = 1;! !break; ! !case MotionEvent.ACTION_MOVE:! ! !touchEvent = "MOVE";! ! !xpos = myScreenWidth-x*touchPadScaleX;! ! !ypos = y*touchPadScaleY;! !break;!

Page 28: Developing for Google Glass

Demo

Page 29: Developing for Google Glass

Sensors   Ketai Library for Processing

  https://code.google.com/p/ketai/

  Support all phone sensors  GPS, Compass, Light, Camera, etc

  Include Ketai Library   import ketai.sensors.*;!  KetaiSensor sensor;!

Page 30: Developing for Google Glass

Using Sensors   Setup in Setup( ) function

  sensor = new KetaiSensor(this);!  sensor.start();!  sensor.list();

  Event based sensor reading void onAccelerometerEvent(…)!{! accelerometer.set(x, y, z);!}!

Page 31: Developing for Google Glass

Sensor Demo

Page 32: Developing for Google Glass

Other Tools   App Inventor – visual programming for Android

  http://appinventor.mit.edu/

  Phone Gap – Android Apps using Javascript   http://phonegap.com/

  Phone Gap for Glass   https://github.com/brendajin/googleglass-phonegap-example

  WearScript   Using Javascript/HTML to develop Glass Applications   http://www.wearscript.com/

Page 33: Developing for Google Glass

Mirror API + Glass GDK

Page 34: Developing for Google Glass

Timeline Metaphor

Page 35: Developing for Google Glass

Glassware and Timeline

Page 36: Developing for Google Glass

Glassware and Timeline   Static Cards

  Static content with text, HTML, images, and (link to) video.   e.g. notification messages, news clip

  Live Cards   Dynamic content updated frequently.   e.g. compass, timer

  Immersions   Takes over the whole control, out from timeline.   e.g. interactive game

Page 37: Developing for Google Glass

Glassware Development   Mirror API

  Server programming, online/web application   Static cards / timeline management

  GDK   Android programming, Java (+ C/C++)   Live cards & Immersions

  https://developers.google.com/glass/

Page 38: Developing for Google Glass

  REST API   Java servlet, PHP, Go,

Python, Ruby, .NET   Timeline based apps

  Static cards -  Text, HTML, media attachment (image & video) -  Standard and custom menu items

  Manage timeline -  Subscribe to timeline notifications -  Sharing with contacts -  Location based services

Mirror API

Page 39: Developing for Google Glass

Mirror API based Web App

3. Insert a static card

User sees the card

Glassware Web app

Page 40: Developing for Google Glass

Develop with Mirror API   Create a Google APIs Console project   Prepare a web server

  https callback for OAuth 2.0  Minimum storage for credentials

  Create a web application   Java servlet, PHP, Go, Python, Ruby, .NET   Implement Oauth 2.0 authentication  Use Mirror API to make REST API calls

-  Wrapper classes/methods provided

Page 41: Developing for Google Glass

Example

Page 42: Developing for Google Glass

Example

Page 43: Developing for Google Glass

Example

Page 44: Developing for Google Glass

Example

Page 45: Developing for Google Glass

Example On your Glass

Page 46: Developing for Google Glass

GDK   Glass Development Kit   Android 4.0.3 ICS + Glass specific APIs   Use standard Android Development Tools

Page 47: Developing for Google Glass

GDK   GDK add-on features

  Timeline and cards  Menu and UI   Touch pad and gesture  Media (sound, camera and voice input)

Page 48: Developing for Google Glass

Live Cards vs. Immersions   Live cards display frequently updated

information to the left of the Glass clock.   Integrate rich content into the timeline   Simple text/images to full-blown 3D graphics

  Immersions let you build a user experience outside of the timeline.   Build interactive experiences   Extra control, less user input constraints

Page 49: Developing for Google Glass

Live Cards vs. Immersions

Page 50: Developing for Google Glass

Live Cards

Page 51: Developing for Google Glass

Immersions

Page 52: Developing for Google Glass

Develop with GDK   Android 4.0.3 (API 15) SDK and GDK Sneak

Peek from the Android SDK Manager.   Project settings:

  Minimum and Target SDK Versions: 15   Compile with: GDK Sneak Peek   Theme: None (allows the Glass theme to be applied.)

  GDK samples   File > New Project > Android Sample Project

  On Glass, turn on USB debugging   Settings > Device Info > Turn on debug

Page 53: Developing for Google Glass

Example   Android App with a full-screen Activity   Add Voice Trigger to launch   Handle touch input   Manipulating timeline

Page 54: Developing for Google Glass

Example   Add Voice Trigger to launch

  Add intent filter to AndroidManifest.xml

Page 55: Developing for Google Glass

Example   Add Voice Trigger to launch (continued)

  Add xml/voice_trigger.xml to res folder

  Add voice_trigger_title string resource

Page 56: Developing for Google Glass

Example   Handle touch input

Page 57: Developing for Google Glass

Example   Adding static cards to timeline

Page 58: Developing for Google Glass

Summary   Use Mirror API if you need ...

  Use GDK if you need ...

  Or use both

Page 59: Developing for Google Glass

Resources   Main Developer Website

  https://developers.google.com/glass/

  Glass Apps Developer Site   http://glass-apps.org/glass-developer

  Google Glass Emulator   http://glass-apps.org/google-glass-emulator

  AR for Glass Website   http://www.arforglass.org/

Page 60: Developing for Google Glass

Books   Programming Google Glass

  Eric Redmond

  Rapid Android Development: Build Rich, Sensor-Based Applications with Processing  Daniel Sauter

Page 61: Developing for Google Glass

More Information

  Mark Billinghurst  [email protected]

  Gun Lee   [email protected]