advertisement

Google Glass Mirror API Setup

56 %
44 %
advertisement
Information about Google Glass Mirror API Setup
Software

Published on September 26, 2014

Author: fwwsc

Source: slideshare.net

Description

Basic set up for the Google Mirror API quick start java project.
advertisement

1. DEVELOPING FOR GOOGLE GLASS MIRROR-API

2. SO, WHAT IS GLASS?

3. Google Glass has a timeline, and you can scroll forward and backward through it by using the touchpad on the side.

4. Ok, cool, but is Mirror API difficult to develop for? NO. THE SETTINGS ARE WHAT TAKES LONG.

5. I’M CONFUSED! WHAT’S THE DIFFERENCE BETWEEN MIRROR API AND GDK?

6. MIRROR API IT’S ALL ABOUT THE CLOUD. GDK IS ALL ABOUT INSTALLING SOFTWARE ON YOUR DEVICE.

7. THE PHONE ISN’T DEAD. GOOGLE GLASS IS NOT HERE TO REPLACE YOUR PHONE.

8. DON’T ANNOY THE USER, PLAN FOR MICRO INTERACTIONS

9. Playground

10. There is no emulator for glass, just the playground: HTTPS://DEVELOPERS.GOOGLE.COM/GLASS/TOOLS-DOWNLOADS/PLAYGROUND

11. The card The body

12. PRE-REQUISITES: • A Macintosh or PC • A Gmail account • Internet Service and most importantly: • Positive attitude! but…

13. CURIOUS FACT: YOU DON’T NEED GOOGLE GLASS TO START DEVELOPING FOR MIRROR API, BUT IT IS RECOMMENDED TO TEST ON A DEVICE WHEN YOU’RE READY TO SHOW THE USER.

14. SETTING THE ENVIRONMENT FOR

15. STEP 1 DOWNLOAD JDK FROM http://www.oracle.com/technetwork/java/javase/downloads/index.html **If you get a versioning problem, try JDK 7.

16. STEP 2 DOWNLOAD BINARY MAVEN FROM http://maven.apache.org/download.cgi Maven will gladly compile the project for us and also download all the external libraries your project will use.

17. STEP 3 DOWNLOAD GOOGLE APP ENGINE FILES FOR JAVA FROM https://developers.google.com/appengine/downloads CLICK FIRST You need the SDK to upload the project to Google App Engine.

18. STEP 4 ENVIRONMENT VARIABLES WINDOWS Open PC info, Advanced System Settings, Environment Variables and add the following variables (locally, top part). Modify the paths to where you have stored your folders. These are the recommended paths: JAVA_HOME C:<path to java>jdk1.8.0_11 JAVA %JAVA_HOME%bin M2_HOME C:<path to mvn>apache-maven-3.2.2-binapache-maven-3.2.2 M2 %M2_HOME%bin GAE_HOME C:<path to gae>appengine-java-sdk-1.9.8appengine-java-sdk-1.9.8 GAE %GAE_HOME%bin PATH %Path%;%JAVA%;%M2%;%GAE%

19. ENVIRONMENT VARIABLES MACINTOSH /*Modify the paths to where your folders are stored. These are the recommended settings. */ //Open terminal vim ~/.bash_profile //press “i” to insert: export M2_HOME=/Users/<path to mvn>/apache-maven-3.2.2 export M2=$M2_HOME/bin export GAE_HOME=/Users/<path to gae>/appengine-java-sdk-1.9.10 export GAE=$GAE_HOME/bin export PATH=$PATH:$M2:$GAE ! //Press Esc, “:w” to write and “:q” to quit editor ! //It’s not necessary to add JDK here but you need to have it installed.

20. STEP 5 GO TO THE CONSOLE AND CLICK NEW PROJECT https://console.developers.google.com/

21. This will be the URL of your site! Keep it handy!

22. 1 Look for the word “Mirror” and turn on Google Mirror API 2 3 Check terms and click “Accept” 4

23. 1 Add Email Add Name This is fairly new, Google asks for a name and email to run a project. Save changes.

24. 1 2 Write those URLs but change the project ID for the one you created! 3 4

25. STEP 6 DOWNLOAD THE JAVA QUICK START PROJECT FROM https://github.com/googleglass/mirror-quickstart-java Download Zip

26. UNZIP THE FILE AND IMPORT IN ECLIPSE 1 2

27. 1 Browse to the root where the pom.xml file is, and click finish. 2

28. Spread the folder tree, and search for the src/main/resourcesoauth.properties

29. Copy the client id and secret from the OAuth page in the google developers console to the oauth file, and save. 2

30. Create an “appengine-web.xml” file in the WEB-INF folder 1 Add the following text and in the <application> tag change the application id to the project you created! 2

31. In the pom.xml file, add the <packaging> line after the <version> tag. 1 2

32. RUN ON LOCALHOST: OPEN A TERMINAL OR COMMAND PROMPT AND CD TO WHERE THE POM.XML FILE IS LOCATED AND RUN: mvn clean install ! mvn war:war ! mvn jetty:run ! open a browser and visit -> http://localhost:8080 MAKE SURE EVERYTHING RUNS WELL ON LOCALHOST BEFORE UPLOADING TO GOOGLE APP ENGINE.

33. Mac/Windows TO STOP THE JETTY SERVER, JUST CONTROL+C THE TERMINAL/ COMMAND PROMPT

34. Free server to upload your project to:

35. BEFORE UPLOADING FROM WINDOWS…FIND THE “APPCFG.CMD” FILE IN THE GOOGLE APP ENGINE SDK/ BIN FOLDER change the word “java” for the location of your JDK so it doesn’t use the JRE. Use quotations.

36. RUNNING ON GOOGLE APP ENGINE WINDOWS Open a cmd window and CD to where the pom.xml file is. ! mvn clean install ! mvn war:war ! Modify the path to where your project is stored: ! appcfg.cmd update C:<path to glass-java-starter>target glass-java-starter-0.1-SNAPSHOT

37. RUNNING ON GOOGLE APP ENGINE MACINTOSH Open a terminal window and CD to where the pom.xml file is ! mvn clean install ! mvn war:war ! Modify the path to where your project is stored: ! appcfg.sh update /Users/<path to glass-java-starter>/target/ glass-java-starter-0.1-SNAPSHOT

38. If everything goes well… head over to your browser and go to: your_project_id.appspot.com!

39. IF SOMETHING IS WRONG WITH YOUR GOOGLE APP ENGINE APPLICATION, 1 YOU CAN ALWAYS CHECK THE LOGS IN THE CONSOLE.DEVELOPERS.GOOGLE.COM TO INVESTIGATE THE ISSUES.

40. Sometimes Google App Engine is not the best solution for your application…

41. Mirror API applications can run on both Google Compute Engine and Amazon Web Services. Google works with a Debian image and amazon works with multiple vm images. The server comes empty and you must install everything from scratch.

42. THE STRUCTURE OF THE PROJECT

43. The only classes/files you need to modify:

44. IF YOU NEED TO ADD JARS…

45. Search for the name of the jar file in the maven repository in Google and copy the code to the pom.xml file under the <dependencies> tag. 1 2

46. EXERCISE TIME!

47. DESIGN YOUR OWN CARD Get the “ex1.html” file from the zip file you downloaded and modify HTML to your taste. When done, put all your HTML in one line. Use Playground to see how it will look. We will insert that card into our Google Glass Timelines. https://developers.google.com/glass/tools-downloads/playground

48. SAMPLE HTML FOR CARD

49. Open the index.jsp file and find the following lines: Just underneath, you should find one of this blocks of code: (next slide) 1

50. Copy paste this block and change the underlined text

51. In the MainServlet.java file, go to line number 117 to the else if statement

52. Copy paste that if else statement right below and replace the if for this text: This is the “value” in the input tag we did before in the index.jsp file! Your HTML string has to be in one long line!

53. SAVE ALL THE FILES!

54. RUN ON LOCALHOST: OPEN A TERMINAL OR COMMAND PROMPT AND CD TO WHERE THE POM.XML FILE IS LOCATED AND RUN: mvn clean install ! mvn war:war ! mvn jetty:run ! open a browser and visit -> http://localhost:8080 MAKE SURE EVERYTHING RUNS WELL ON LOCALHOST BEFORE UPLOADING TO GOOGLE APP ENGINE.

55. CREATED BUTTON Click it.

56. THE CARD WILL GO FROM YOUR APPLICATION TO GOOGLE SERVERS TO THE GLASS DEVICE REGISTERED WITH THE EMAIL USED TO LOGIN TO THE APPLICATION.

57. If you see this, it means the card was sent successfully and it was added to your timeline (even if you don’t own a pair of Google Glasses)

58. OK, WHAT NOW?

59. TO GIVE THE APPLICATION TO YOUR USERS You simply have to give them the URL of your project, and have them login with their credentials and configure the settings on the browser, not glass! It’s that easy!

60. USEFUL LINKS/BOOKS • https://developers.google.com/glass/design/ui • https://developers.google.com/glass/develop/overview DESIGN CODE

61. And so we’ve come to the end of the presentation! My contact information: Diana Melara dm22510n@pace.edu

Add a comment

Related presentations

Speaker: Matt Stine Developing for the Cloud Track Marc Andressen has famou...

This presentation explains how to develop a Web API in Java using (JAX-RS or Restl...

1 App,

1 App,

November 10, 2014

How to bring innovation to your organization by streamlining the deployment proces...

Cisco Call-control solutions can handle voice, video and data

Nathan Sharp of Siemens Energy recently spoke at the SAP Project Management in Atl...

Related pages

Glass | Google Developers

If you're developing enterprise Glassware and want to become a Glass Certifed Partner, ... Mirror API build Tools. Assets ... Google Developer Groups;
Read more

Quick Start | Google Glass Mirror API | Google Developers

The starter projects demonstrate the major functionality of the Google Mirror API ... Google Mirror API. Use your Glass ... quick start projects ...
Read more

Setting up Glass - Google Glass Help

Google Glass Help. Google Glass Contact us. Setting up Glass. ... When prompted from the Glass setup tutorial, choose Android from the Glass tutorial.
Read more

Send and Track Email with Google Glass - SendGrid

Send and Track Email with Google Glass ... track emails via Glass using the Google Mirror API and ... Event API and setup a webhook to ...
Read more

Help – Google Glass

Google Glass Setup; MyGlass; Glassware; Explorers; Support; Contact us. Glass Help ... Glass Wifi Setup Connect ...
Read more

How to use Google APIs in Glass - Stack Overflow

google-glass google-mirror-api. share | improve this question. edited Feb 11 '14 at 13:46. asked Feb 11 '14 at 8:51. Steve. 160 13 ...
Read more

Google Glass

Thanks for your interest. You’ll start to see future versions of Glass when they’re ready (for now, no peeking).
Read more

GitHub - googleglass/mirror-quickstart-dotnet: Google ...

mirror-quickstart-dotnet - Google Mirror API's Quickstart for .NET ... googleglass / mirror-quickstart-dotnet. ... //www.googleapis.com/auth/glass.timeline
Read more

Google Code Archive - Long-term storage for Google Code ...

Export to GitHub google-glass-api. Loading... Google; About Google; Privacy; Terms
Read more