Upload
internet-of-things-dc
View
406
Download
3
Tags:
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
Rapid Prototyping Google Glass Apps using WearScript
Preview!
Jared Alexander
Quick Intro
Jared Alexander
Senior Mobile Developer
Adjunct Professor
@jaredalexander
Co-Founder
teaching Android development
iOS, Android, Wearable app development
My Development Background
Web
Mobile
Wearables
Time
Google Glass - What is it?“a wearable computer with an optical head-mounted display that is being developed by Google” -Wikipedia
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
So you want to build a quick prototype app for Google Glass?
What if you only needed to know HTML & Javascript?
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
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
How does it work?
WearScript APK
Native access to hardware
● Camera● GPS● Gyro● Accel.● more!
WebView
JavaScript Code
“Run”
“injected” inside
WearScript JS Interpreter
● Google Glass● Arduino (microcontroller)● Myo (armband)● Pebble (watch)● more...
Compatible Devices
Google Glass & WearScript
● Create user interface “cards”○ can include HTML formatting
● Detect gestures
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
});
Google Glass & WearScript
● Recognize speech
● Access the camera○ scan QR codes○ snap pictures, record videos
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/
Storing your WearScripts in Gists
● Login to cloud IDE with Github○ Saving from cloud IDE saves to your Github Gists
Live Demo
1. WearScript provided sample app
2. iBeacon detection demo
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!
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
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
Next Week
● Hands-on WearScript workshop, BYOG!
Questions?