23
Rapid Prototyping Google Glass Apps using WearScript Preview! Jared Alexander

Rapid Prototyping Google Glass Apps Using WearScript

Embed Size (px)

DESCRIPTION

Internet of Things DC Meetup - October 14, 2014 Google Glass -- Where to start? Here's a straightforward overview of Google Glass from Jared Alexander plus a walkthrough on how to develop your first app using WearScript. What's WearScript? Read on... WearScript is a framework that combines the power of Android development on Glass with the learning curve of a typical JavaScript website. How awesome is that? Not as complicated as you thought? Let the coding begin...and let us know what you come up with: Tweet your cool projects to @iotDC and we'll put together a best-of list for everyone to see.

Citation preview

Page 1: Rapid Prototyping Google Glass Apps Using WearScript

Rapid Prototyping Google Glass Apps using WearScript

Preview!

Jared Alexander

Page 2: Rapid Prototyping Google Glass Apps Using WearScript

Quick Intro

Jared Alexander

Senior Mobile Developer

Adjunct Professor

@jaredalexander

Co-Founder

teaching Android development

iOS, Android, Wearable app development

Page 3: Rapid Prototyping Google Glass Apps Using WearScript

My Development Background

Web

Mobile

Wearables

Time

Page 4: Rapid Prototyping Google Glass Apps Using WearScript

Google Glass - What is it?“a wearable computer with an optical head-mounted display that is being developed by Google” -Wikipedia

Page 5: Rapid Prototyping Google Glass Apps Using WearScript

Dual-Core CPU, 1 GB RAM16 GB Storage

Bluetooth, Wi-FiGPS, Compass

Accelerometer, Gyroscope

Bone Conduction Speaker

IR/Proximity SensorWink Detection

On-Head Detection

Microphone

Google Glass Hardware Breakdown

Prism Display (640x360 px)

Battery

5 MP Camera720P Video

TouchPad

Page 6: Rapid Prototyping Google Glass Apps Using WearScript

So you want to build a quick prototype app for Google Glass?

Page 7: Rapid Prototyping Google Glass Apps Using WearScript
Page 8: Rapid Prototyping Google Glass Apps Using WearScript

What if you only needed to know HTML & Javascript?

Page 9: Rapid Prototyping Google Glass Apps Using WearScript

What is WearScript?

● a framework that combines power of Android development on Glass with the learning curve of a website

● Use a cloud IDE to write JavaScript that runs instantly on Glass inside a WebView

● Get started at http://wearscript.com ● One line to install on your Glass:

curl -L http://goo.gl/nRjW6y > install.py && python install.py

Page 10: Rapid Prototyping Google Glass Apps Using WearScript

What is WearScript?

● Project goals:○ simplifying development on Glass○ easy integration with other peripherals and

hardware devices○ exploring research topics (e.g. Computer Vision,

Augmented Reality, Crowdsourcing, Accessibility)● Project Lead - Brandyn White

○ Intern at Google X○ PhD Candidate at University of MD

Page 11: Rapid Prototyping Google Glass Apps Using WearScript

How does it work?

WearScript APK

Native access to hardware

● Camera● GPS● Gyro● Accel.● more!

WebView

JavaScript Code

“Run”

“injected” inside

WearScript JS Interpreter

Page 12: Rapid Prototyping Google Glass Apps Using WearScript

● Google Glass● Arduino (microcontroller)● Myo (armband)● Pebble (watch)● more...

Compatible Devices

Page 13: Rapid Prototyping Google Glass Apps Using WearScript

Google Glass & WearScript

● Create user interface “cards”○ can include HTML formatting

● Detect gestures

Page 14: Rapid Prototyping Google Glass Apps Using WearScript

Google Glass & WearScript

● Listen and respond to sensor data○ ibeacon○ pupil○ gyroscope○ gps○ accelerometer○ magnetic field○ orientation○ light○ gravity○ linear acceleration○ rotation vector

WS.sensorOn(WS.sensor(‘gps’),5,function(data){var latitude = data[‘values’][0];var longitude = data[‘values’][1];//do something with coordinates

});

Page 15: Rapid Prototyping Google Glass Apps Using WearScript

Google Glass & WearScript

● Recognize speech

● Access the camera○ scan QR codes○ snap pictures, record videos

Page 16: Rapid Prototyping Google Glass Apps Using WearScript

Google Glass & WearScript

● Text to speech WS.say(‘Hello World’);

● Play sounds WS.sound(‘SUCCESS’);

● Much, much more at http://www.wearscript.com/en/latest/

Page 17: Rapid Prototyping Google Glass Apps Using WearScript

Storing your WearScripts in Gists

● Login to cloud IDE with Github○ Saving from cloud IDE saves to your Github Gists

Page 18: Rapid Prototyping Google Glass Apps Using WearScript

Live Demo

1. WearScript provided sample app

2. iBeacon detection demo

Page 19: Rapid Prototyping Google Glass Apps Using WearScript

Get started in less than 5 minutes!

● Place Glass in “debug mode”● Connect Glass to your computer via USB● Run curl -L http://goo.gl/nRjW6y > install.py && python install.py● Go to http://api.wearscript.com● Pair Glass to your web development

environment by scanning QR code● Start (wear) scripting!

Page 20: Rapid Prototyping Google Glass Apps Using WearScript

WearScript Downsides

● no way (yet) to package up WearScript app into standalone app for distribution (e.g. Google Play)

● Google Glass auto-updates itself, sometimes breaking WearScript - must wait for WearScript devs to fix (or fix yourself!)○ but developers are very responsive!

● Battery life reduced due to web socket open to WearScript cloud IDE

Page 21: Rapid Prototyping Google Glass Apps Using WearScript

Useful Links

● http://www.wearscript.com/en/latest/○ documentation

● https://api.wearscript.com○ cloud IDE

● https://github.com/kurtisnelson/wearscript-android○ all the code is open-source on Github

● https://plus.google.com/+BrandynWhite○ creator of WearScript, lots of neat videos detailing

his research

Page 22: Rapid Prototyping Google Glass Apps Using WearScript

Next Week

● Hands-on WearScript workshop, BYOG!

Page 23: Rapid Prototyping Google Glass Apps Using WearScript

Questions?