×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Question Wants to add multiple contacts in to Handset Contacts list

    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.

  2. #2
    Super Contributor
    Join Date
    Jan 2008
    Location
    Amravati, India
    Posts
    546

    Re: Wants to add multiple contacts in to Handset Contacts list

    Read JSR 75 PIM & Fileconnection API specification from Sun Microsystems

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Wants to add multiple contacts in to Handset Contacts list

    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 -
    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();
    Hope these lines can help you,
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    23

    Re: Wants to add multiple contacts in to Handset Contacts list

    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.

Similar Threads

  1. How to get list of contacts programmatically
    By skvladimir in forum Russian Developer Forum - Форум Российских разработчиков
    Replies: 5
    Last Post: 2008-08-04, 19:25
  2. How to get the list of contacts programmatically
    By skvladimir in forum Series 40 & S60 Platform Feedback Archive
    Replies: 1
    Last Post: 2008-07-28, 12:49
  3. Multiple Selection List
    By Deepa msc in forum Mobile Java General
    Replies: 2
    Last Post: 2008-07-28, 11:35
  4. Replies: 3
    Last Post: 2005-11-29, 08:11
  5. How to add entries to To-Do List (V Urgent)
    By dijox in forum Symbian C++
    Replies: 1
    Last Post: 2002-07-16, 19:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •