Search code examples
google-glassgoogle-mirror-api

Use Google Glass Mirror API to scan QR code


I have the Google Mirror API's Quick Start for PHP up and running on a Microsoft Azure Website and can communicate with Google Glass.

I had a closer look to the options like the "request/response" example:

 case 'insertItemWithAction': 
   $new_timeline_item = new Google_TimelineItem(); 
   $new_timeline_item->setText("What did you have for lunch?"); 

   $notification = new Google_NotificationConfig(); 
   $notification->setLevel("DEFAULT"); 
   $new_timeline_item->setNotification($notification); 

   $menu_items = array(); 

   // A couple of built in menu items 
   $menu_item = new Google_MenuItem(); 
   $menu_item->setAction("REPLY"); 
   array_push($menu_items, $menu_item); 

   $menu_item = new Google_MenuItem(); 
   $menu_item->setAction("READ_ALOUD"); 
   array_push($menu_items, $menu_item); 
   $new_timeline_item->setSpeakableText("What did you eat? Bacon?"); 

   $menu_item = new Google_MenuItem(); 
   $menu_item->setAction("SHARE"); 
   array_push($menu_items, $menu_item); 

(from https://github.com/googleglass/mirror-quickstart-php/blob/master/index.php)

I am now wondering if it is possible to use the Google Glass Mirror API to scan a QR code.

The idea is to replace the user having to speak a control digit, convert the control digit to a QR code and have the user scan the QR code without having to speak.

Is this possible?


Solution

  • You cannot present a QR Code scanning screen to your user by only using the Mirror API. Nor can you add a MenuItem allowing the user to send back a picture.

    But, you can register as a contact, and have your users share with you pictures containing QR Codes.

    This is not a very fluid user experience, but it's the only way you could "scan" QR Codes while only using the Mirror API.