×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2010
    Posts
    136

    reading the data from the contact list?

    Can we read the whole contact list from the MIDlet?
    In the emulator i use , there is always two contacts.
    MY midlet just read the data I have entered.

    And sometime it produces the error if I try to read the fields that was not written by me.
    For example, if I write some contact in the contact list (but not name)
    if I try to read name, there is an application error?

    Why? In the real application, there may be many records in the phone book.
    And some data will be missing to be filled?
    in that condition, will the application error occur?

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: reading the data from the contact list?

    Can we read the whole contact list from the MIDlet?
    In the emulator i use , there is always two contacts.
    MY midlet just read the data I have entered.
    YES, you can read all the data that exists in the phone book or the contact list.

    And sometime it produces the error if I try to read the fields that was not written by me.
    For example, if I write some contact in the contact list (but not name)
    if I try to read name, there is an application error?
    You can read only the fields that exists and have some valid data stored in them for a particular contact record.

    Why? In the real application, there may be many records in the phone book.
    And some data will be missing to be filled?
    in that condition, will the application error occur?
    You would be 1st required to check if the particular field that you are trying to read from a contact is supported by the contact item and exists in it.
    For example before reading Contact.NAME field you should do something like this:
    Code:
    try {
                                    if(list.isSupportedField(Contact.NAME) && contact.countValues(Contact.NAME) > 0)	                                    
                                        {
                                        String[] newname = contact.getStringArray(Contact.NAME, 0);
                                        }
                                    }catch(Exception e){}
    Thanks,
    Ekta

Similar Threads

  1. Problem in Reading contact list.
    By raviksoni in forum Symbian
    Replies: 1
    Last Post: 2010-07-07, 09:15
  2. cannot add new contact list in my contact list application
    By dexth in forum Mobile Java General
    Replies: 0
    Last Post: 2009-10-10, 12:31
  3. Contact List access produces three(!) prompts about reading and writing user data
    By kartik_vad in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-05-23, 13:40
  4. add contact from contact list
    By gopikishan in forum General Development Questions
    Replies: 1
    Last Post: 2009-04-21, 16:41
  5. Replies: 2
    Last Post: 2008-01-04, 09:58

Posting Permissions

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