Google Glass apps or Glassware can be developed with nearly any programming language and we will show you how to use the most popular ones in order to start making Glassware. Today we’ll show you the basics of developing Google Glass apps with Go.
Please note that this only works if you are in the Glass Explorer program. Otherwise you will not be able to use the Mirror API.
In order to start developing with Go, you will need to download the Go App Engine SDK and create a Google App Engine instance. This is pretty easy, especially if you follow the step-by-step tutorial below.
Download the Go App Engine SDK first.
Go to AppSpot, create an application and make sure to leave the authentication open to all Google account users. Make sure to remember the application identifier as you’re going to need it later.
You will now have to create a Google Mirror API, so head over to the Google APIs console and create a new API project. Then head over to Services and enable Mirror API. Now you will have to go to API Access and create an OAuth 2.0 client ID. Now you can also add the app’s name, website URL and you should also upload an icon.
On the next page select Web Application and specify the hostname, which can be localhost.
Now click Edit Settings and add the following URLs:
http://localhost:8080/oauth2callback. You will now see your app’s client ID and secret. Save those somewhere as you’re going to need them.
Now you will have to configure your project. So open
config.go and enter your client ID and client secret, along with a session secret string that you will have to generate.
// Created at http://code.google.com/apis/console, these identify
// our app for the OAuth protocol.
clientId = "[[YOUR_CLIENT_ID]]"
clientSecret = "[[YOUR_CLIENT_SECRET]]"
secret = "[[YOUR_SESSION_SECRET]]"
Add your App Engine Application ID to
In order to deploy the project, head over to the App Engine Launch GUI and click Deploy. If you want to deploy it from command line, then use this command:
$ appcfg.py --oauth2 update .
You can also find the Google Glass Mirror API Quick Start for Go on .