You Are Here:

Community: Developer Discussion Boards

#1 Old Retrieve Contact list application - 2007-10-30, 14:00

Join Date: Oct 2007
Posts: 144
Location: Noida
Abhishek_karmakar's Avatar
Abhishek_karmakar
Offline
Regular Contributor
hello all Coders,
I am tryin to retrive all the contact list from the phone in my midilet. there is a lot of code given in internet but dosent works for me. So i modified it for myself in the following manner ..

------------------------------------------------------

public void Fill_phone()
{
String err = null;
PIM p = PIM.getInstance();
err = "line1";
ContactList cl = null;
err = "line2";
Image img = new Ima


{
err = "line3";
cl = (ContactList)p.openPIMList(PIM.CONTACT_LIST,PIM.READ_ONLY);
err = "line4";
// Enumeration en = cl.items();
err = "line5";
for(Enumeration enn = cl.items();enn.hasMoreElements();)
{err = "line6";
String phno = null;
err = "line7";
Contact c = (Contact)enn.nextElement();
err = "line8";
int p_no = c.countValues(Contact.TEL);
err = "line9";
for(int i = 0;i<p_no;i++)
{
err = "line10";
phno = c.getString( Contact.TEL,i);
err = "line11";
}
list1.append(phno,null);
err = "line12";
}


}
catch(PIMException e)
{
stringItem1.setText(e.toString() + err);
}
}

---------------------------------------------------------------------------

now i want to retrive the Names and am not able to do it . i have tried a bit but am not able to work it out . please help

thanks in Advance
Reply With Quote

#2 Old Re: Retrieve Contact list application - 2007-11-02, 13:52

Join Date: Sep 2007
Posts: 115
Location: Thirunelveli
senthil_k
Offline
Regular Contributor
Hi ,
You can get the names by:
if (cl.isSupportedField(Contact.FORMATTED_NAME))
c.getString(Contact.FORMATTED_NAME,0)
if Contact.FORMATTED_NAME is not supported try with Contact.NAME. I am refering the variable mentioned in your code.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
List Box application techietintu Symbian User Interface 10 2007-04-03 09:34
how to get the installed application list ?? shadi.alalem General Symbian C++ 3 2007-02-26 23:54
how to show a list box in my application bharats Symbian User Interface 11 2006-11-15 12:34
6680 and bluetooth service profiles ceruault Mobile Java Networking & Messaging & Security 1 2005-10-08 23:24
Contact list access daverussell Smart Messaging 0 2002-12-12 20:22

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ