Contact wrapper for android DOWNLOAD HERE



public class Contact
extends java.lang.Object

Version:
1.0
Author:
Paul Hallett www.phalt.co.uk

Code snippet:
Adding a contact with a name and a number
Example:
Contact con = new Contact(this.getApplicationContext);
con.startNew();
con.addName("Tyler Durden");
con.addNumber("012345678");
con.commit();

Constructor Summary
Contact(Context context)
          Standard Constructor
 
Method Summary
 void addAddress(java.lang.String address)
          Add an address to the contact NOTE: Should only be used after Contact.startNew();
 void addEmail(java.lang.String email_address)
          Add an email address to a new contact NOTE: Should only be used after Contact.startNew();
 void addHomePhone(java.lang.String number)
          Add a home phone number to a new contact NOTE: Should only be used after Contact.startNew();
 void addImage(java.io.ByteArrayOutputStream image)
          Add An image to the contact
 void addMobilePhone(java.lang.String number)
          Add a mobile phone number to a new contact NOTE: Should only be used after Contact.startNew();
 void addName(java.lang.String name)
          Add a name to a new contact NOTE: Should only be used after Contact.startNew();
 void addNote(java.lang.String note)
          Add a note to the contact NOTE: Should only be used after Contact.startNew();
 void addWorkPhone(java.lang.String number)
          Add a work phone number to a new contact NOTE: Should only be used after Contact.startNew();
 void commit()
          Finalise and stores a new contact.
 void startNew()
          Initiates new contact builder.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Contact

public Contact(Context context)
Standard Constructor

Parameters:
context - (Context) Context of the application using this wrapper
Method Detail

startNew

public void startNew()
Initiates new contact builder. Finalise build with Contact.commit(); After adding desired contact details. NOTE: Contact.addName() is REQUIRED to save a new contact.


commit

public void commit()
Finalise and stores a new contact. NOTE: Should only be used after Contact.startNew(); Contact.addName() is REQUIRED to save a new contact.


addName

public void addName(java.lang.String name)
Add a name to a new contact NOTE: Should only be used after Contact.startNew();

Parameters:
name - (String) Name of the contact

addMobilePhone

public void addMobilePhone(java.lang.String number)
Add a mobile phone number to a new contact NOTE: Should only be used after Contact.startNew();

Parameters:
number - (String) Mobile phone number of the contact

addHomePhone

public void addHomePhone(java.lang.String number)
Add a home phone number to a new contact NOTE: Should only be used after Contact.startNew();

Parameters:
number - (String) Home phone number of the contact

addWorkPhone

public void addWorkPhone(java.lang.String number)
Add a work phone number to a new contact NOTE: Should only be used after Contact.startNew();

Parameters:
number - (String) Work phone number of the contact

addEmail

public void addEmail(java.lang.String email_address)
Add an email address to a new contact NOTE: Should only be used after Contact.startNew();

Parameters:
email_address - (String) Email address of the new contact

addAddress

public void addAddress(java.lang.String address)
Add an address to the contact NOTE: Should only be used after Contact.startNew();

Parameters:
address - (String) An address of the contact

addImage

public void addImage(java.io.ByteArrayOutputStream image)
Add An image to the contact

Parameters:
image - (ByteArrayOutputStream) An image for the contact as a ByteArrayOutputStream

addNote

public void addNote(java.lang.String note)
Add a note to the contact NOTE: Should only be used after Contact.startNew();

Parameters:
note - (String) A note about the contact

SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD