Code example for Person

Methods: getAboutMe, getBirthday, getDisplayName, getGender, getId, getName, getNickname, hasGender, hasImage, hasName

0
	 */ 
	public UserProfile (Person person, String accountName) {
		 
		// Setup Google login parameters 
		googleUsername = accountName;
		googleId = person.getId();
 
		name = person.getDisplayName();
		email = accountName;
		 
		if (person.hasGender()) {
			switch (person.getGender()) {
			case Person.Gender.MALE:
				gender = "male";
				break; 
			case Person.Gender.FEMALE:
				gender = "female";
				break; 
			case Person.Gender.OTHER:
				gender = "other";
				break; 
			} 
		} 
				 
		if (person.getAboutMe() != null)
			description = person.getAboutMe();
		if (person.getBirthday() != null) {
			// Convert from yyyy-mm-dd to mm/dd/yyyy 
			String bd = person.getBirthday();
			birthday = bd.substring(5,7) + "/" + bd.substring(8, 10) + "/" + bd.substring(0, 4);
			Log.v(TAG, "Dateofbirth: " + bd + " -> " + birthday);
		} 
		 
		if(person.hasName() && person.getName().hasGivenName())
			firstName = person.getName().getGivenName();
		if(person.hasName() && person.getName().hasFamilyName())
			lastName = person.getName().getFamilyName();
		if (person.hasNickname()) 
			nickname = person.getNickname();
		else { 
			if (Utilities.has(firstName))
				nickname = firstName;
			if (Utilities.has(lastName)) {
				if (Utilities.has(nickname))
					nickname += " " + lastName.substring(0, 1) + ".";
				else 
					nickname = lastName.substring(0, 1) + ".";
			} 
		} 
 
		 
		if (person.hasImage()) {
			String path = person.getImage().getUrl();
 
			// Get a bigger image if there's a size default 
			int index = path.indexOf("?sz=");
			if (index != -1) {