I am trying to read phone Contact list in a N70 phone, but I am not being able to get it.When i try it on the WTK emulator it works comletely fine, but when I run it on the N70 phone it does not show me anything.
I have the following doubts...
1. I have created a vCard and stored it in the C:\WTK2.5.1\appdb\DefaultColorPhone\pim\contacts\Contacts
folder and while reading from the emulator it displays the phone number from here. But on the real device how does it look up into the Contact List?
2. If I have to read a phone number from the contact List of my phone then what are the steps that I should follow to do that? Do I need to use the method importContact()?
My function that tries to read the phone number is attached below,
Thanks a Lot,
public String read_data()
String mesg = null;
cList = (ContactList)PIMList(PIM.CONTACT_LIST,PIM.READ_WRITE);
contacts = cList.items();
c = (Contact) contacts.nextElement();
int tel = c.countValues(Contact.TEL);
for(int i=0; i<tel; i++)
if ((c.getAttributes(Contact.TEL,i) != 0 ) & Contact.ATTR_HOME != 0)
mesg = c.getString(Contact.TEL,i);
System.out.println("The telephone Number is : " + mesg);
mesg = "Error in Reading data";