After tackling the relatively complicated fields of NAME
and TEL
, the EMAIL
field should be a lot easier. Making sure that your contacts have an e-mail address is the whole point of this task because these will be used later on when testing another feature. Knowing that the Address Book application allows you to have up to three e-mail addresses, how would you think they are implemented in the PIM? Is it implemented as a String
with multiple values (such as the TEL
field), or as a StringArray
(such as the NAME
field)? If you chose a String
with multiple values, you chose correctly!
The EMAIL field actually fits well with this concept of a String
field with multiple values. Unlike the TEL
fields, there are no attributes that are attached to each of the e-mail addresses, so adding one simply adds it to the list and there is nothing more to be concerned about. So let's look at some code already!