Hi,
I want to know whether, is it possible to add the several contacts in to Handset's contacts list. I have one contacts file,
and i want it parse and ad in to the contacts list. Can anybody tell me how to this? Thanks in advance.
Hi,
I want to know whether, is it possible to add the several contacts in to Handset's contacts list. I have one contacts file,
and i want it parse and ad in to the contacts list. Can anybody tell me how to this? Thanks in advance.
Read JSR 75 PIM & Fileconnection API specification from Sun Microsystems
Hi,
Well, you can use the JST 75..called as PIM API..for the details you can just browse the link below,
http://library.forum.nokia.com/index...w-summary.html
For the underlined task you can use the code as below -
Hope these lines can help you,PIM pim = PIM.getInstance();
ContactList clist;
try {
clist = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
} catch(Exception e) {
// security or other exception
}
// Retrieve contact values
// The countValues() method returns the number of data values currently
// set in a particular field.
Enumeration contacts = clist.items();
Contact c = (Contact) contacts.nextElement();
int phoneNumbers = c.countValues(Contact.TEL);
for(int i = 0; i < phoneNumbers; i++) {
if((c.getAttributes(Contact.TEL) != 0) & Contact.ATTR_HOME != 0) {
// Home number
String home = c.getString(Contact.TEL, i);
}
}
//Add contact values
Contact c = clist.createContact();
int attrs = Contact.ATTR_HOME;
c.addString(Contact.TEL, attrs, "416-799-1313");
// Some fields can be added without attributes
c.addString(Contact.ORG, PIMItem.ATTR_NONE, "someName Corporation");
// Add the item to the native contact database
c.commit();
Thanks,
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,
Thanx Raj, for the reply.
I will try this thing. And can u plz tell me wheather it will write single contact at a time or the contact list? I want to add all contacts.