Rendezvous for Glass

From Immersive Visualization Lab Wiki
Jump to: navigation, search

Contents

Project Overview

When meeting up with friends, this Glassware can let you know where your friends are and how far they are from the destination.

Project Goals

  • Get friends' information from server and display it on Glass
  • Show a Google map using Static Maps API

Resources

  • Google Glass

Technologies

  • Glass Development Kit (GDK)
  • Static Maps API

Project

Progress

  • Added a QUIT menu item to remove the live card from timeline
  • Added a voice command to start the app
  • Added text to display friends' names and distances from destination
  • Added a static Google map with markers indicating friends' current location
  • Added codes to update the map and friends' information once per second
  • Added codes to show a spinner icon when loading the map

TODO

  • When loading the map, make the spinner icon spin
  • Communicate with server to get latitude, longitude and zoom for the static map, as well as friends' names, locations and distances from destination (see details below)
  • When starting the app, check network status first and if there is no internet access, show an error in the Glassware.
  • When showing friends' information, implement a ScrollView that can scroll with head motion (Just like speaking "ok glass" brings up a command list that automatically scrolls based on the user's head motion)

Develop

Ongoing Task Pattern is used.

  • src\main\res\layout\map_layout.xml - Defines the layout for the main view
  • src\main\java\edu\ucsd\rendezvous\RendezvousView.java - The main view that uses the previous layout as it's UI.
  • src\main\java\edu\ucsd\rendezvous\RendezvousDrawer.java - Defines how to render the view. The live card service calls this class to draw to the live card service.
  • src\main\java\edu\ucsd\rendezvous\RendezvousService.java - Manages the rendezvous live card and handles the service lifecycle.
  • src\main\java\edu\ucsd\rendezvous\LiveCardMenuActivity.java - Declares the translucent menu activity that immediately shows the menu when the activity is visible.


To get data from server, changes need to be done in updateFriendsInfo() and updateMap() in src\main\java\edu\ucsd\rendezvous\RendezvousView.java.

updateFriendsInfo():

   /**
    * update friends info
    * store them in friends_info
    * use them to update infoStr and markers
    */
   public void updateFriendsInfo()
   {
       friends_info.clear();
       /**
        * TODO: get friends' names/latitudes/longitudes/distances from server and store them in friends_info.
        */
       updateMarkers();
       updateInfo();
   }

note: friends_info is an object of List<friendInfo>:

   private class friendInfo
   {
       public double latitude, longitude, distance;
       public String name;
       friendInfo(double la, double lo, double d, String fname)
       {
           latitude = la;
           longitude = lo;
           distance = d;
           name = fname;
       }
   };
   private List<friendInfo> friends_info;

updateMap():

   /**
    * update map's latitude/longitude/zoom
    * update map_url
    */
   public void updateMap()
   {
       /**
        * TODO: get new latitude/longitude/zoom from server.
        */
       map_url = makeStaticMapsUrl(latitude, longitude, zoom);
   }

Get the source code

The source code is on GitHub as RendezvousForGlass. Please talk to Jurgen to get access.