Skip to Content
Author's profile photo Basar Ozgur Kahraman

Google Glass quick start demo on HANA

Nowadays, wearable devices are one of the hot topics of technology. Google just released its Android Wear SDK and Google Glass is becoming more common in daily life. Until November 2013, only the developers that have Google glass device could develop applications for glass. But after November 2013 Google opened Mirror API for all developers.


You have two options to develop for glass:

  1. Mirror API:The Google Mirror API allows you to build web-based services, called Glassware, that interact with Google Glass. It provides this functionality over a cloud-based API and does not require running code on Glass.
    • With Mirror API, you can;
      • Managing timeline cards
      • Interacting with menu items
      • Subscribing to timeline notifications
      • Sharing to contacts
      • Working with user location
  2. Glass Development Kit: The Glass Development Kit (GDK) is an add-on to the Android SDK that lets you build Glassware that runs directly on Glass.

Ps: Our demo application was developed by Mirror API, so rest of the blog is about Mirror API.


To develop applications on glass with Mirror API, Google serves us different libraries for .Net, Java, Javascript, Objective-C, Php, Python, Ruby, Dart, Go. if you need you can look into samples for each library.


Run Google Glass application on SAP Hana Cloud platform


Prerequisites:

Ps: I strongly recommend to you follow openSAP courses of Thomas Jung  and Rui Nogueira about Hana Topic


In this blog scope we will use Java Quick Start Demo of Google. Google also serves demo projects in other platforms, i chose Java platform because Hana cloud platform can run java applications. I modified original demo to run on Hana Cloud Platform. In original demo project, Google uses Apache Maven to manage package dependencies. To prevent you fighting with packages, i export my modified demo in war file, so i suggest you to use attached war file.


At the end of the operations we will deploy demo to Hana Cloud Platform. Then users will authorize via created url on cloud platform. After successful login, current timestamp, name and location of user are saved to Hana Database and a timelinecard is posted with the last logged in users data.


Deploy Quick Start Demo:


There is two major task to deploy demo

  1. Creating a Google APIs Console project:

Google has a detail tutorial to create a console project. You can follow the instructions.

The created client ID and client secret for my project:

Capture1.JPG

  1. Importing project to hana studio

Download attached .war file and import project into Hana studio. (If you want to try Quick start demo independently from Hana studio, please download .zip file, import it as archieve project into eclipse)

/wp-content/uploads/2014/03/import_418013.jpg

If everything is OK Then;

  • Open “oauth.properties” file under “com.google.glassware” package and copy your client_id & client_secret values that were created in Google Api Console project.
  • Set Context Root to “/” from project->properties->”Web Project settings” (after login, google redirect you to project root, i don’t want to change original project so leave like this)
  • If needed, change java version from project->properties->”Project Facets” (application is running smoothly with java 1.6 or 1.7)
  • if you using eclipse instead of Hana Studio install m2e in eclipse and be sure Maven library is setted from project->properties->”Deployment Assembly”

/wp-content/uploads/2014/03/import_418013.jpg

The modifications & new developments over original demo project;

  • For new developed classes, com.hana package was created
  • UserInfo class was created, to get&keep user login info
  • HanaMirrorClient class was created, to post timelinecard on glass
  • UserDAO class was created, to manage Hana database operations (jdbc was used)
  • Append Hana Log” button was added into index.jsp file
  • to get user info, UserInfo instance was created in index.jsp file
  • To post a new timelinecard as soon as user login, NewUserBootstrapper class was modified


After all the last operation is deploying project. To deploy on Sap Hana Cloud, in hana studio go to servers section, add a new Hana Cloud Portal Server and run your project on hana server.(For this step, You can find detail instructions on Rui Nogueira openSap videos).

Ps:If you run project in eclipse, Download Tomcat(version is very important I tried with Tomcat7.0.52), add it as a new server in eclipse and run your project on Tomcat Server.


Test Your Project:


Open Hana Cloud cockpit and go to your deployed application details. There is a url to run your application. You can run my application via https://hanaonglass1p104935trial.hanatrial.ondemand.com to post yourself a timelinecard.

Capture5.JPG

Capture2.JPG

If you wonder how timelinecard will look on google glass device, you can use google playground application via https://developers.google.com/glass/tools-downloads/playground . In order to use the Playground with the Google Mirror API, you need to insert your project’s client ID. To test my application paste “236007231554.apps.googleusercontent.com” to textbox and click authorize.

Capture4.JPG

Capture3.JPG

I’m living in Turkey and Google Glass hasn’t sold here yet. So i should say that i couldn’t try application on device. If someone who has glass maybe try application on device, and we will be very glad with feedbacks.


Update: (01.05.2014)

Thanks a lot to Randy Middleton. He run demo on glass and send screenshots to us. Now we are sure that demo is working on device smoothly(Google Glass Explored XE16.11 – XE16.2). Nice collaboration in SCN Community !! 😎

Update2: (29.08.2014)

Thanks a lot to Markus Van Kempen. He deployed the code to his own trial cloud account. Now we are sure that attached code can be deployed without defect and it is working on device with version XE 20.1 flawlessly.

GGlass-demo-994_x.jpg

GGlass-demo-665_x.jpg

GGlass-demo-576_x.jpg

Files:

Assigned tags

      26 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Eitan Rosenberg
      Eitan Rosenberg

      Hi,

      Thank for sharing of things to come....

      Regards.

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Thanks for your comments!!

      Author's profile photo ASHISH AHIRE
      ASHISH AHIRE

      Hi @Basar Ozgur Kahraman ,

                                                 You always come with something new ..... very nice ..... keep it up 🙂

      Regards,

      Ashish

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Thank you Ashish,

      i like playing with new technologies 🙂

      Author's profile photo Archana Shukla
      Archana Shukla

      Loved reading the blog !

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Glad to hear that ! 🙂

      Author's profile photo Former Member
      Former Member

      Basar,

      Do you still need someone with Glass to try this for you?  I have Glass and just ran across this article.     It looks very interesting and I would be willing to give it a try and send you a Glass vignette screenshot of the timeline card.

      Jeff

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Hi Jeff,

      I'll be much appreciated, if you can try this demo on device. I am very curios about how timelinecard looks on glass screen. if you send me screenshots, i will attached them to this blog. Thank you for your attention!

      Best Regards

      Basar Ozgur

      Author's profile photo Former Member
      Former Member

      You brought sap to another level.

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Hi Ralph,

      Sap Hana introduces us new capabilities, the only thing we should use them for different domains with various technologies.

      Thank you!

      Author's profile photo Former Member
      Former Member

      Thanks Basar,

      I have Google Glass also.  Google Glass Explored XE16.11.  Updated  28-April-2014.  No issues on Glass so far.

      I am going through your demo.  Thanks again for you blog and this demo.

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Hi Randy,

      it is very nice to hear that 🙂 At last someone could try demo on device. Can you take screenshots? i want to publish screenshots of device on blog. i will be greateful if you send me.

      Thank you

      Regards

      Author's profile photo Former Member
      Former Member

      GGlass-demo-408_x.jpg

      Author's profile photo Former Member
      Former Member

      GGlass-demo-576_x.jpg

      Author's profile photo Former Member
      Former Member

      Here is a screen capture that shows the Start of the application on Glass.  Your Cat.

      Vignette that has the Start-up of Java Demo.

      Thanks, RandyGGlass-demo-665_x.jpg

      Author's profile photo Former Member
      Former Member

      Amazing innovation, to tap into hana from Google glass...

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Thank you very much for your motivating comment..

      Author's profile photo Hemendra Sabharwal
      Hemendra Sabharwal

      Awesome blog Basar, It's a next level jump. Thank you so much for sharing and encouraging to go further with this new innovative ideas where one feet in Google Glass and another in HANA Cloud both of peaks of new technologies.

      Thanks,

      Warm Regards

      Hemendra

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Hi Hemendra,

      Thank you for the kind words..

      Regards

      Basar Ozgur

      Author's profile photo Stenish Peter S
      Stenish Peter S

      Amazing blog!! Thank you so much for sharing such a nice innovation.

      Author's profile photo Former Member
      Former Member

      I liked this blog. It is amazing to see this types of innovative jobs. Thanks for sharing.. I am looking forward to new ones ; )

      Author's profile photo Former Member
      Former Member

      Great blog. I was researching something about Google Glass and HANA.

      Infact I am building a prototype to show Google Charts on Google Glass, fetching data from Hana database.

      Interested for more collaboration. if interested let me know.

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Thank You Ritesh,

      You can reach me via direct message.

      Regards..

      Author's profile photo Former Member
      Former Member

      Awesome work .... just deployed the code and it works flawlessly with XE 20.1.

      https://hanaonglasss0003409446trial.hanatrial.ondemand.com/

      CheersSDN.png

      Author's profile photo Basar Ozgur Kahraman
      Basar Ozgur Kahraman
      Blog Post Author

      Happy to hear that 🙂

      Now we are sure that it is also working on version XE 20.1. I am updating the blog..

      Thank you very much Markus!!

      Author's profile photo Former Member
      Former Member

      yes realy happy to hear this!!!