Google Eyewear development Mirror API's Go language development

Source: Internet
Author: User
Tags oauth
This is a creation in Article, where the information may have evolved or changed.

Original address: http://bbs.seacat.cn/thread-868-1-2.html



Go Language Quick Start

Welcome to the Go language Quick Start Project! This project will show you a simple demo to implement on Google glasses . To introduce The main features of the Google Mirror API.

for a complete quick start project, jump to https://glass-java-starter-demo.appspot.com . Otherwise, read on to see how to deploy on your own version.

Pre-conditions

the appenginesdk for Go language. the Go Language Quick Start Project is implemented using App Engine . You need Go App enginesdk to develop and deploy your project. Run the installer for your platform , or extract the zip file in a suitable place.

Create a Google App Engine instance

you need to run a quick Start project in Google App Engine on.

1. Open http://appspot.com.

2. Click Create App to create a public Google appengine instance hosted in Appspot.com.

3. Assign an application identifier to the application to open the authentication to all users of the Google account. You will need this application identifier later to configure the Quick Launch project.

Create a Google API Console Project

Next , Make Access Google Mirrorapi

1. go to the Google API Console to create a new API project.

2. Click Services and enable Google Mirrorapi for your new project .

this stage Mirrorapi for the developer preview version , the API applies to developers only. As part of the Google Eyewear Explorer program.



3. Click Apiaccess to create an OAuth 2.0 client ID for the Web application.




4. Specify the product name and icon for your Google glasses. These fields appear on the OAuth grant screen and are presented to the user.



5. Select WebApplication and specify a value for host name, such as localhost.






6 . Click Editsettings ... Specifies a URI redirect for the client ID. Specify the callback URL for Http://localhost:8080/oauth2callback and AppEngine, For example, https:// Myappengineinstance.appspot.com/oauth2callback.






7. Note that the client ID and password are assigned to the GOOGLEAPI console. You will need these to configure the Quick Launch project.





Configuration Items
Configure a quick Start Project with your API client information 1. In Config.go: Enter your client ID and secret

Createdat Http://code.google.com/apis/console, these identify//our app for the OAuth protocol.clientid     = "[Your_ CLIENT_ID]] "Clientsecret =" [[Your_client_secret]] "


2. Generate a string to configure it in Config.go
Secret      = "This should really is a secret."/Make it a random string


3. Enter your App Engine app ID to edit App.yaml
Application:your_appengine_application_idversion:1runtime:goapi_version:go1 ...


Deployment Project Press the blue button in the application engine to deploy the start GUI interface or run the shell command to deploy the code
$ appcfg.py--oauth2 Update


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.