×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Apr 2007
    Location
    Estonia, Tallinn
    Posts
    8

    Exclamation PIM: Contact: unable to read more than 2 E-mail values from a contact

    Description:
    It is unable to read more than 2 existing E-mail address values using PIM API.

    Details:
    User can add up to 5 E-mail values to a contact using native phonebook.
    PIMItem method countValues(Contact.EMAIL) returns correct count of values (5).
    Method getString(Contact.EMAIL, index) with the index > 1 throws IndexOutOfBoundsException.

    Affected platforms:
    S40 3rd Edition
    S40 5th Edition
    S40 6th Edition

    Steps to reproduce:
    1. Create a contact with 3 or more email values using native phonebook
    2. Enumerate all EMAIL values using PIM API (see example below)
    Result:
    IndexOutOfBoundsException is thrown on getting value with index >= 2


    Example:
    Ensure that you have only one contact in phonebook with 3 or more email values.

    Code:
    PIM pim = PIM.getInstance();
    PIMList list = pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
    Enumeration en = list.items();
    while (en.hasMoreElements()) {
        Contact contact = (Contact) en.nextElement();
        int count = contact.countValues(Contact.EMAIL);
        for (int index = 0; index < count; index++) {
            System.out.println(index + ":");
            try {
                String value = contact.getString(Contact.EMAIL, index);
                System.out.println(value);
            } catch (IndexOutOfBoundsException e) {
                System.out.println(e.toString());
            }
        }
    }
    Output will look like this:
    Code:
    0:
    email1@null.com
    1:
    email2@null.com
    2:
    java.lang.IndexOutOfBoundsException
    3:
    java.lang.IndexOutOfBoundsException
    4:
    java.lang.IndexOutOfBoundsException
    PS.
    I'm experiencing some problem with logging system out on Series 40 6th Edition SDK v0.9. You can log it on any previous S40 emulator.

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

    Thumbs up Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hi,
    well if the countValues(Contact.EMAIL) returns the correct values then there must be some problem in the iteration of the loop you are doing...check the same..

    getString(Contact.EMAIL, index) with the index > 1 throws IndexOutOfBoundsException.
    Why you are starting the index >1...no point..for this..

    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Apr 2007
    Location
    Estonia, Tallinn
    Posts
    8

    Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hi,
    well if the countValues(Contact.EMAIL) returns the correct values then there must be some problem in the iteration of the loop you are doing...check the same..
    Is there some problem in the code example?
    countValues returns 5 and I should be able to read all 5 email values with indexes 0-4

    Why you are starting the index >1...no point..for this..
    See example above. No comments.

    Please qualify this issue.

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

    Thumbs up Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hi,
    No one can understand the problem without looking into the complete code..can you put the source code..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Apr 2007
    Location
    Estonia, Tallinn
    Posts
    8

    Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    I attached the complete working code with the output it produces in the first post.
    The only thing you should do is to inject this code to the MIDlet. For example it could be done within implemented startApp() method. It's your choice.
    And before running this code you have to create contact with 5 email addresses on phone memory.


    Br,
    Gennadi

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

    Thumbs up Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hey,
    Where is the code,
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hi,

    I confirm that the problem can be reproduced using the provided code on Nokia S40 5th and 6th edition SDK device emulators.

    raj_J2ME, in case you want to reproduce the problem:
    1. Copy/paste the code provided by ydanneg into any midlet.
    2. Install that midlet to Nokia S40 5th edition SDK emulator.
    3. Create a single contact in phonebook that contains 3 or more emails.
    4. execute that midlet and see the provided code throws exceptions as ydanneg described.

  8. #8
    Registered User
    Join Date
    Apr 2007
    Location
    Estonia, Tallinn
    Posts
    8

    Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Issue was reported to Nokia Technical Support.

    Thanks.

  9. #9
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: PIM: Contact: unable to read more than 2 E-mail values from a contact

    Hello ydanneg and solmaks,

    Issue was reported to Nokia Technical Support.

    Thanks.
    Our internal experts have verified this issue. For further information on the scope and testing this issue are available in this Forum Nokia Wiki Known Issue article:

    http://wiki.forum.nokia.com/index.ph...m_in_Series_40

    Currently there are no solutions or workarounds to this issue. In case of further updates to this issue, the related Known Issue article will be the first resource to have the information (plus this thread will be updated also).

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Can not browse contact list using PIM API
    By khatrijuned in forum Mobile Java General
    Replies: 0
    Last Post: 2008-04-07, 14:32
  2. JSR PIM contact wrong Date problem.
    By sj314 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2007-10-09, 10:34
  3. Replies: 1
    Last Post: 2006-09-21, 00:40
  4. How to read integer and float values from a file?
    By Falcons in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-06-04, 04:57
  5. unable to read message
    By muneendra78 in forum General Messaging
    Replies: 1
    Last Post: 2002-10-31, 02:53

Posting Permissions

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