×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    1

    Post On nokia 6080 i am able to read contact name but not able read contact number

    Hi...

    Could you please help me on following risk

    Description:
    On nokia 6080 device i am trying to reading and displaying contacts, I am able to read contact name but,not able to read contact number.

    I am using below code for reading contact number


    private void readTelephoneFields(PIMList list, Contact contact) {



    if (list.isSupportedField(Contact.TEL) && contact.countValues(Contact.TEL) > 0) {
    int totalTelFields = contact.countValues(Contact.TEL);
    String value;


    int attr;


    for (int i = 0; i < totalTelFields; i++) {
    value = contact.getString(Contact.TEL, i);


    attr = contact.getAttributes(Contact.TEL, i);

    switch (attr) {

    case Contact.ATTR_WORK:


    workPhone_Main.addElement(value);// <Work TelephoneNumber>
    break;
    case Contact.ATTR_HOME:

    homePhone_Home.addElement(value);// <HomeTelephoneNumber>

    break;
    case Contact.ATTR_MOBILE:

    mobilePhone_Main.addElement(value);// <MobileTelephoneNumber main>

    break;
    case Contact.ATTR_MOBILE + Contact.ATTR_WORK:

    // mobile work
    mobilePhone_Work.addElement(value);

    break;
    case Contact.ATTR_MOBILE + Contact.ATTR_HOME:

    //mobile home
    mobilePhone_Home.addElement(value);

    break;
    case Contact.ATTR_PAGER:

    Pager = value;// <PagerNumber>

    break;
    case Contact.ATTR_FAX:

    //fax main
    mainFax.addElement(value);
    numbers.append(value);
    break;
    case Contact.ATTR_FAX + Contact.ATTR_WORK:


    // fax work
    workFax.addElement(value);

    break;
    case Contact.ATTR_FAX + Contact.ATTR_HOME:


    //fax home
    homeFax.addElement(value);

    break;
    case Contact.ATTR_NONE:

    case Contact.ATTR_OTHER:

    homePhone_Main.addElement(value);// <OtherTelephoneNumber>

    break;


    }

    }

    }

    }
    }
    Thanks && Regards
    Rosapa Naidu.P

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: On nokia 6080 i am able to read contact name but not able read contact number

    Quote Originally Posted by rosapanaidu.p View Post
    Hi...

    Could you please help me on following risk

    Description:
    On nokia 6080 device i am trying to reading and displaying contacts, I am able to read contact name but,not able to read contact number.

    I am using below code for reading contact number


    private void readTelephoneFields(PIMList list, Contact contact) {



    if (list.isSupportedField(Contact.TEL) && contact.countValues(Contact.TEL) > 0) {
    int totalTelFields = contact.countValues(Contact.TEL);
    String value;


    int attr;


    for (int i = 0; i < totalTelFields; i++) {
    value = contact.getString(Contact.TEL, i);


    attr = contact.getAttributes(Contact.TEL, i);

    switch (attr) {

    case Contact.ATTR_WORK:


    workPhone_Main.addElement(value);// <Work TelephoneNumber>
    break;
    case Contact.ATTR_HOME:

    homePhone_Home.addElement(value);// <HomeTelephoneNumber>

    break;
    case Contact.ATTR_MOBILE:

    mobilePhone_Main.addElement(value);// <MobileTelephoneNumber main>

    break;
    case Contact.ATTR_MOBILE + Contact.ATTR_WORK:

    // mobile work
    mobilePhone_Work.addElement(value);

    break;
    case Contact.ATTR_MOBILE + Contact.ATTR_HOME:

    //mobile home
    mobilePhone_Home.addElement(value);

    break;
    case Contact.ATTR_PAGER:

    Pager = value;// <PagerNumber>

    break;
    case Contact.ATTR_FAX:

    //fax main
    mainFax.addElement(value);
    numbers.append(value);
    break;
    case Contact.ATTR_FAX + Contact.ATTR_WORK:


    // fax work
    workFax.addElement(value);

    break;
    case Contact.ATTR_FAX + Contact.ATTR_HOME:


    //fax home
    homeFax.addElement(value);

    break;
    case Contact.ATTR_NONE:

    case Contact.ATTR_OTHER:

    homePhone_Main.addElement(value);// <OtherTelephoneNumber>

    break;


    }

    }

    }

    }
    }
    Thanks && Regards
    Rosapa Naidu.P
    Please some debug - or SOP's counters to check if the code is going inside - if (list.isSupportedField(Contact.TEL) && contact.countValues(Contact.TEL) > 0) {}
    Is the code working as desired on other devices ?
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Can't read general phone number from contact in S40 5130 device
    By starryshen in forum Mobile Java General
    Replies: 2
    Last Post: 2011-05-17, 09:13
  2. read phone number from contact database
    By yahoo2010 in forum Symbian
    Replies: 4
    Last Post: 2011-02-27, 13:15
  3. read contact one by one
    By kuddy_abc in forum Symbian
    Replies: 3
    Last Post: 2010-12-14, 05:11
  4. Replies: 8
    Last Post: 2009-02-27, 11:37
  5. how to read contact phone number...
    By chaoraksa in forum Mobile Java General
    Replies: 1
    Last Post: 2009-02-13, 09:19

Posting Permissions

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