Google Glass Connects With JavaScript

New WearScript code library allows developers to use JavaScript to more easily create apps for Google Glass.

Thomas Claburn, Editor at Large, Enterprise Mobility

October 15, 2013

2 Min Read
InformationWeek logo in a gray background | InformationWeek

Developing Google Glass applications just became significantly easier. A group of doctoral students in computer science, working under the project name OpenShades, has released WearScript, a code library that allows developers to write Glass apps in JavaScript.

For the past few months, developers have had other options. Google offers the Mirror API to create cloud-based applications that can communicate with Glass in a limited way. The more full-featured Glass Development Kit (GDK), which will let developers create Glassware using Android code, has not yet been released, but developers have been getting by with incomplete device access through the Android SDK and NDK.

Google only began reviewing third-party Glass apps for inclusion on users' My Glass pages about a week ago. And the company requires that submitted apps adhere to its terms of service and developer policies. As a result, there are only a handful of Glass apps available.

[ Will Apple's next iPad break new ground, or just be another incremental upgrade? Read Apple's Next iPad: Gateway To Mobile Revolution. ]

Brandyn White, a PhD candidate, faculty assistant at the University of Maryland and part of the OpenShades team, said that Glass development needs to be simple and fast, and should be better suited for making personally relevant applications. "[G]oing through the standard Android app development [process] takes too long for exploring a new idea," he said in a Google+ post.

"For many of the cool hacks people are doing on Glass, they would be much easier to write using something like WearScript," said White in an email. "We are putting significant effort into making the scripts easy to share. We regularly pass them around while we're working, [and] it takes a few seconds to try them out. There is a place for WearScript, Mirror, Android SDK/NDK, and eventually the GDK. All we're focused on now is making WearScript a great platform to hack on and show off what Glass can do."

WearScript lets developers write JavaScript code that interacts with Glass hardware. It can display the HTML5 Canvas element, images and text on the Glass screen. It can trigger events based on location, illumination or other sensor-based criteria. And it can process text converted from a Glass user's speech.

In a video posted to YouTube, White demonstrates how WearScript can be used to create a shopping list that shows up in Glass when he walks into a grocery store wearing the device. The app can tell when he has arrived by monitoring his GPS coordinates and the light level change that occurs when entering the store from outside.

The future of Google Glass looks brighter when it's taken beyond Google's control.

About the Author

Thomas Claburn

Editor at Large, Enterprise Mobility

Thomas Claburn has been writing about business and technology since 1996, for publications such as New Architect, PC Computing, InformationWeek, Salon, Wired, and Ziff Davis Smart Business. Before that, he worked in film and television, having earned a not particularly useful master's degree in film production. He wrote the original treatment for 3DO's Killing Time, a short story that appeared in On Spec, and the screenplay for an independent film called The Hanged Man, which he would later direct. He's the author of a science fiction novel, Reflecting Fires, and a sadly neglected blog, Lot 49. His iPhone game, Blocfall, is available through the iTunes App Store. His wife is a talented jazz singer; he does not sing, which is for the best.

Never Miss a Beat: Get a snapshot of the issues affecting the IT industry straight to your inbox.

You May Also Like


More Insights