Reading contacts from PIM
Hi.
Ive been trying to read contact from PIM for a long time now and search the web over and over again but this just doesnt work. It work on all phones EXCEPT the SonyEricsson w950, where i only get the NAME_FAMILY, i also tried to replace NAME_FAMILY with all other NAME fields without success. And i tried to use the toSerialFormat but it is so slow on the w950 so i really want to be able to do it without the toSerialFormat. Any one with some information how to solve this issue?
Code:
PIMpim = PIM.getInstance();
String[] data_formats = pim.supportedSerialFormats(PIM.CONTACT_LIST);
ContactListcontactList = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
int[] tmpFields;
String tempNames = "";
// SEARCH CONTACT
Enumeration contacts = contactList.items();
Contact c;
while(contacts.hasMoreElements()){
c = (Contact) contacts.nextElement();
tmpFields = c.getFields();
try {
tempNames += c.getStringArray(Contact.NAME, Contact.NAME_GIVEN)[0]+ " ";
} catch (Exception e) {}
}
try {
tempNames += c.getStringArray(Contact.NAME, Contact.NAME_FAMILY)[0]+ ":";
} catch (Exception e) {}
}

