In this post, I’ll guide you on how to open a custom or your own app using the default voice commands in the Google glass.
I want to mention at this point, that to do this you need to have some knowledge on Android programing. And do this exercise in the emulator we created in our last post, don’t try it on the real glass because it may malfunction the glass, I have not tested it in the glass .Try it in your glass at your own risk.
If we see how the google glass works, it will open a certain app(apk) using the package name for a predefined voice command.
As for now we don’t have an sdk to develop our own voice command and an app to open from it. So what I am gona do here is replace a default app that will launch for a voice command and gona launch our own app instead.
In this example, I am gona replace glasscamera with my own app. To do so backup the glass camera app, and delete it from the glass.
First refactor the package name of your app to “com.google.glass.camera”
Now open your app’s manifest file
In the manifest file, change the package name in to “com.google.glass.camera”
Then change the Intent filter inside the activity tag of your app with this Intent filter
But there are some important stuffs you have to look into and research, before you jump into the app development. With limited hardware resources, the capability of the devices is restricted. At the time of writing this article the Explorer Edition 7 update is released and we can do some stuffs like, take a photo, record a video, start a hangout, send an email, browse web and some other stuffs.
The device is not like phone, where it does not have a touch display, the glass works by voice commands and mostly by tapping and scrolling the side of the glass. So you cannot expect to add buttons sliders. Still an SDK is not released to develop app for the glass.
If you have been wondering on what would it take for someone to get up and running with google glass development. Following is a list of technologies that forms the technology stack for google glass:
Well, we can start on with what Google Glassers have termed as “Glassware“. Glassware is a piece of software built on top of Google Mirror API. Google Mirror API is a set of Restful web services which help to communicate to and fro with google glass devices. Lets look at the diagram below to understand a little better.
Above depicts interaction between google glass device and glasswares based on google mirror API.
What one can do using Google Mirror API?
Creating new cards on a timeline
Updating current cards on a timeline
Receiving user-initiated input exposed through a card’s menu
Subscribing to notifications from Glass devices to be notified of user actions
lets see the Google Glass – Mirror API – Glasswares – High Level Architecture
Lets try and understand the above architecture:
Glass users subscription to your service: You develop one or more web-based service for google glass and publish. These services can be termed as glasswares. Glass users subscribes to your service by logging on to your website authenticating themselves using OAuth 2.0
Glassware updates using Mirror API: Your google glassware then starts publishing to google glass cloud using mirror API. To be able to that, you must register your service with google cloud.
Google Glass synchronizes with glass device: This is third aspect. Once your glassware publishes to google cloud using mirror api, google glass then synchronizes your updates to your subscribed users.
You can control the glassware sites you have subscribed by logging in to MyGlass account . You can access this with the MyGlass Android App too.
In the above image you can see my glassware “Batman’s Layer” is listed with the other glasswares I have subscribed.
Ok then In my next post we will see what you needed to start developing for Google Glass …!