Skip to content

Instantly share code, notes, and snippets.

@thinkingserious
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkingserious/8747069 to your computer and use it in GitHub Desktop.
Save thinkingserious/8747069 to your computer and use it in GitHub Desktop.
AddressBook.java for SendGrid Google Glass SDK
package com.thinkingserious.sendgrid.glass.gdk.example;
import java.util.HashMap;
/*
Since the voice recognition in Glass makes it hard to speak email addresses, we instead use nicknames
Once Contacts are implemented in the GDK, we can replace this class
*/
public class AddressBook {
private HashMap<String, String> emails;
// You may want to use some external source to populate this data
public AddressBook(){
emails = new HashMap<String, String>();
emails.put("Elmer".toUpperCase(), "elmer.thomas@sendgrid.com");
emails.put("OmniFocus".toUpperCase(), "send-to-omnifocus@omnigroup.com");
}
public HashMap<String, String> getEmails() {
return emails;
}
public String getEmail(String name){
String email = emails.get(name.toUpperCase());
if( email != null ) {
return email;
} else {
email = "Email not recognized, tap to reset.";
}
return email;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment