Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Google Glass for Secure Access Control

Using Google Glass for Secure Access Control

A presentation I gave at GDG DevFest NL 2014 about using Google Glass for Secure Access Control. Shows the different options for Glassware development and how to port an Android app to Glassware.

Peter Verhage

November 08, 2014
Tweet

More Decks by Peter Verhage

Other Decks in Programming

Transcript

  1. http://www.egeniq.com [email protected] @egeniq GDG DevFest NL - 8th of November

    2014 Peter Verhage Using Google Glass for Secure Access Control
  2. Who am I? • @petercv • CTO Egeniq • Developer

    • Glass Explorer since June of 2014 2
  3. About Egeniq • “Smart apps for smart devices” • Only

    developers • Knowledge company • Mdevcon • R&D • Distributed / “Nieuwe werken”
 
 3
  4. History • Tiqr • Mobile / web authentication solution •

    First Egeniq project • Developed for SURFnet in 2010 • Android and iOS apps • Open Source (Apache license) • https://tiqr.org • https://github.com/SURFnet/tiqr 10
  5. History • Tiqr Glass • Visited San Francisco last June

    • Made an appointment at the local
 Google Glass Basecamp • “What can we do with this?” • Contacted SURFnet • Tiqr Glass was born 11
  6. GDK vs Mirror API 13 GDK Mirror API Location Device

    Cloud Language Java Any Access to sensors All None Android based Yes No
  7. GDK vs Android • Android 4.4.2 SDK (API level 19)


    • Glass add-ons: • Voice commands • Touch gestures • Cards 14
  8. GDK: Voice Commands • Launch app using voice command
 •

    Register as intent filter in manifest: 
 <activity          android:name=".main.MainActivity"          android:icon="@drawable/ic_launcher"          android:label="@string/app_name"  >          <intent-­‐filter>                  <action  android:name="com.google.android.glass.action.VOICE_TRIGGER"  />          </intent-­‐filter>          <intent-­‐filter>                  <action  android:name="android.intent.action.MAIN"  />                  <category  android:name="android.intent.category.LAUNCHER"  />          </intent-­‐filter>          <meta-­‐data                  android:name="com.google.android.glass.VoiceTrigger"                  android:resource="@xml/voice_trigger"  />   </activity>
 15
  9. GDK: Voice Commands • Define command as resource: 
 <trigger

     command="START_A_RUN"  />       • Even prompt for additional info: 
 <trigger  command="POST_AN_UPDATE">          <input  prompt="@string/glass_voice_prompt"  />   </trigger>
 • Lots of built-in commands:
 (LISTEN_TO, FLIP_A_COIN, REMIND_ME, …)
 16
  10. GDK: Voice Commands • Define your own commands: 
 <trigger

     keyword="@string/authenticate_voice_trigger">          <constraints  camera=“true"  network="true"  />   </trigger>
 • Requires development permission: 
 <uses-­‐permission  android:name="com.google.android.glass.permission.DEVELOPMENT"  />   
 • Can’t be submitted to Glassware Gallery
 • Google open to new generic commands 17
  11. GDK: Voice Commands • Contextual voice commands
 • Activate for

    activity using: 
 getWindow().requestFeature(WindowUtils.FEATURE_VOICE_COMMANDS);   
 • Uses menu resources 18
  12. GDK: Touch Gestures • Simple gestures > D-pad key events:

    • Tap: KEYCODE_DPAD_CENTER • Camera: KEYCODE_CAMERA • Swipe down: KEYCODE_BACK • Etc. @Override   public  boolean  onKeyDown(int  keycode,  KeyEvent  event)  {          if  (keycode  ==  KeyEvent.KEYCODE_DPAD_CENTER)  {                  //  user  tapped  touchpad,  do  something                  return  true;          }          ...          return  super.onKeyDown(keycode,  event);   } 19
  13. GDK: Touch Gestures • Gesture Detector
 • Simple gestures (similar

    to D-pad key events) 
 GestureDetector  gestureDetector  =  new  GestureDetector(context);   gestureDetector.setBaseListener(new  GestureDetector.BaseListener()  {          @Override          public  boolean  onGesture(Gesture  gesture)  {                  if  (gesture  ==  Gesture.TAP)  {                          //  do  something  on  tap                          return  true;                }  else  if  (gesture  ==  Gesture.SWIPE_RIGHT)  {                          //  do  something  on  right  (forward)  swipe                          return  true;                  }  else  if  (gesture  ==  Gesture.SWIPE_LEFT)  {                          //  do  something  on  left  (backwards)  swipe                          return  true;                  }                  return  false;          }   }); 20
  14. GDK: Touch Gestures • Complex gestures (scroll, multiple fingers) 


    public  boolean  onGesture(Gesture  gesture)  {          if  (gesture  ==  Gesture.TWO_TAP)  {                    //  do  something  on  two  finger  tap                    return  true;          }          return  false;   }       gestureDetector.setFingerListener(new  GestureDetector.FingerListener()  {          @Override          public  void  onFingerCountChanged(int  previousCount,  int  currentCount)  {                  //  do  something  on  finger  count  changes          }   });   gestureDetector.setScrollListener(new  GestureDetector.ScrollListener()  {          @Override          public  boolean  onScroll(float  displacement,  float  delta,  float  velocity)  {                  //  do  something  on  scrolling          }   });   21
  15. GDK: Touch Gestures • Handle at activity level: 
 @Override

      public  boolean  onGenericMotionEvent(MotionEvent  event)  {          if  (_gestureDetector  !=  null)  {                  return  _gestureDetector.onMotionEvent(event);          }          return  false;   }   • Handle at view level • Create view subclass • Make sure view is focusable and receives focus 
 @Override   public  boolean  dispatchGenericFocusedEvent(MotionEvent  event)  {          if  (isFocused())  {                  return  _touchDetector.onMotionEvent(event);          }          return  super.dispatchGenericFocusedEvent(event);   } 22
  16. GDK: Cards • Simple coherent Glass L&F • Card views

    are created in code using 
 builder pattern 
 View  cardView  =          new  CardBuilder(this,  CardBuilder.Layout.COLUMNS)                  .setIcon(challenge.getIdentityProvider().getLogoBitmap())                  .setText(getString(R.string.authentication_confirmation_message,                                                          challenge.getIdentity().getDisplayName(),                                                          challenge.getIdentityProvider().getDisplayName()))                  .setFootnote(R.string.authentication_confirmation_tap)                  .getView();   setContentView(cardView);   23
  17. GDK: Cards • Embed your own layouts 
 View  cardView

     =            new  CardBuilder(context,  CardBuilder.Layout.EMBED_INSIDE)                  .setEmbeddedLayout(R.layout.food_table)                  .setFootnote("Foods  you  tracked")                  .setTimestamp("today")                  .getView();   
 
 
 
 
 
 
 
 
 25
  18. Tiqr Specifics • Existing Android code refactored to library project

    and Android client (and migrated to Gradle) • ZXing for recognizing and processing QR codes 27
  19. Tiqr Specifics • All layouts are card based • Except

    for the QR scanner • Uses TextureView and custom overlay 28
  20. What’s next? • Pin support? • Voice recognition? (note: not

    voice input) • (For now: only use as 2nd factor) • More clean-up necessary and improve some of the flows 29
  21. Lessons Learned • GDK no brainer if you know Android

    • Most time spent on generalizing plus
 fixing old Android / Java code • Card layouts / voice input is easy • Intuitive interaction biggest challenge 31