×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    116

    Retrieving contact in 6210 Navigator

    Hi

    Everyone i am facing a problem in 6210 Navigator.
    Here i am able to retrieve the contact into my application but i am getting the output in this way..


    ravi/M null null null null null null

    i want only name. so how shall i remove this null. if any informatiton,link or article which solves this problem ,do message me.

    Regards
    Deepu G

  2. #2
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Retrieving contact in 6210 Navigator

    Hi Deepu,

    I don't know weather this will solve your problem , check when ever you are retrieving the particular field value if it is null don't include that field.

  3. #3
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: Retrieving contact in 6210 Navigator

    Hi

    Even i am also facing the same problem in N78. Is it possible to get substring in String Buffer by dleting those nulls. Please give me the suggestions

    Regards
    Deepa

  4. #4
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Retrieving contact in 6210 Navigator

    Hi,

    Can you tell me which method you are using to get the contact details . What is it's return type and all.

  5. #5
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: Retrieving contact in 6210 Navigator

    Hi bhanuchandar.k

    Please go through the following code

    while(items.hasMoreElements())
    {
    Contact c = (Contact)items.nextElement();
    int namecount = c.countValues(Contact.NAME);
    StringBuffer sb = new StringBuffer(30);
    if(namecount > 0)
    {
    String[] name = null;
    name = c.getStringArray(Contact.NAME, 0);
    for(int q = 0; q < name.length; q++)
    {
    sb.append(name[q]);
    }
    } v.addElement(sb.toString());
    String[] ret = new String[v.size()];
    v.copyInto(ret);
    return ret;


    Regards
    Deepa

  6. #6
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Retrieving contact in 6210 Navigator

    Hi Deepa,

    while(items.hasMoreElements())
    {
    Contact c = (Contact)items.nextElement();
    int namecount = c.countValues(Contact.NAME);
    StringBuffer sb = new StringBuffer(30);
    if(namecount > 0)
    {
    String[] name = null;
    name = c.getStringArray(Contact.NAME, 0);
    for(int q = 0; q < name.length; q++)
    {
    if(name[q] != null)
    sb.append(name[q]);
    }
    } v.addElement(sb.toString());
    String[] ret = new String[v.size()];
    v.copyInto(ret);
    return ret;

    You can do like If you don't want to add null to your string buffer.

    One more thing When ever the contact is added to the phone it will have some extra parameter like first name, last name, formatted name etc.. if the user not entered these fields you will get null values. When ever you are retrieving that contact you have to check if it is null don't take that field. In your code.

    what the documentation says is this

    public java.lang.String[] getStringArray(int field,
    int index)

    Get an array of related values from a field in the item.

    Not all elements in the array are required to be supported by the item. If an array index is not supported by this item, null is the value for the String at the array index.

  7. #7
    Regular Contributor
    Join Date
    Nov 2007
    Posts
    88

    Re: Retrieving contact in 6210 Navigator

    Hi bhanuchandar.k


    Thank u for u r help. I will try this one.

    Regards
    Deepa

Similar Threads

  1. Retrieving the contacts into 6210 Navigator
    By deepu28 in forum Mobile Java General
    Replies: 3
    Last Post: 2008-08-31, 23:02
  2. Web access in 6210 Navigator
    By deepu28 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-08-29, 16:24
  3. 6210 navigator
    By gleembru in forum General Development Questions
    Replies: 2
    Last Post: 2008-06-19, 17:26
  4. 6210 Navigator is a FL 3 device not FL 2.1
    By biskero in forum [Archived] Flash Lite on Nokia Devices
    Replies: 7
    Last Post: 2008-02-27, 03:07
  5. Retrieving my Contact telephone numbers from my PC
    By nyamton in forum Bluetooth Technology
    Replies: 0
    Last Post: 2005-01-17, 11:06

Posting Permissions

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