×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    23

    How to retrieve the mobile number or home number or work number

    Hi

    How to retrieve the mobile number or home number or work number
    for particular name in contactList
    does the follwing works to do so

    search_contact = cl.createContact();
    if (cl.isSupportedField(Contact.FORMATTED_NAME)) {
    search_contact.addString(Contact.FORMATTED_NAME, PIMItem.ATTR_NONE, Searchname);
    } else if (cl.isSupportedArrayElement(Contact.NAME,Contact.NAME_GIVEN)) {
    name[Contact.NAME_GIVEN] = Searchname;
    search_contact.addString(Contact.NAME, PIMItem.ATTR_NONE, name [Contact.NAME_GIVEN] );
    }
    int i=0;
    enum = cl.items(search_contact);
    while(enum.hasMoreElements()){
    Contact contact = (Contact) enum.nextElement();
    if(cl.isSupportedField(Contact.FORMATTED_NAME) && cl.isSupportedField (Contact.TEL)) {
    searchName = contact.getString(Contact.FORMATTED_NAME, i);
    String telNumber =contact.getString(Contact.TEL, i);
    String homeNumber =contact.getString(Contact.TEL,Contact.ATTR_HOME);
    String mobileNumber =contact.getString(Contact.TEL,Contact.ATTR_MOBILE);
    }
    }


    regards
    Rameshwari

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: How to retrieve the mobile number or home number or work number

    hi Rameshwari,

    use nokia reference doc for that, it shows how to enumerate contacts and each phone number within contact (it could be zero or more phone numbers in each contact:
    Code:
    Contact contact = (Contact) items.nextElement();
    int telCount = contact.countValues(Contact.TEL);
    ....
    // go through all the phone numbers
    for (int i = 0; i < telCount; i++){
    // check if it is a cell phone and put it at the beginning
                  // this doesn't necessarily work since in many cases it is
                  // up to the user to indicate whether it is a mobile phone
    .....
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

    hth
    regards,
    Peter

Similar Threads

  1. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52
  2. Sending SMS to non-available mobile number
    By psmshankar in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-10-04, 01:35
  3. dial up number transfered to mobile 6210 ( pause sign )
    By mobutu4 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-08-06, 03:06
  4. Self mobile number from SIM Card
    By abhishekmishra in forum Symbian
    Replies: 0
    Last Post: 2002-05-28, 12:56

Posting Permissions

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