BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-02-2010, 02:46 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: telus
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Searching address book contacts

Please Login to Remove!

Hi all,
i have to find Blackberry contacts form address book.
for that i am getting by using this code
Code:
ContactList contactList =
        (ContactList)PIM.getInstance().openPIMList

          (PIM.CONTACT_LIST, PIM.READ_ONLY);
now,i have to implement search functionality so for that i have been using loop to find particular contacts in contacts list therefore it has been taking more time(around 5 sec) if contacts are around more than 1000, but in default Blackberry address book search it is taking less time.
so i am looking for API which can give searched ContactList with name, if any one know kindly reply me.
for that i tried one method but i vein.
Code:
ContactList contactList =
        (ContactList)PIM.getInstance().openPIMList

          (PIM.CONTACT_LIST, PIM.READ_ONLY,"name");
i search on net too, but i did not get suitable thread.
looking for soon reply.

Thanks and Regards
Imran ali
Offline  
Old 07-02-2010, 04:47 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: telus
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Searching address book contacts

hello,
I got the solution myself.
I am replying here for others use.
Code:
ContactList contactList =
        (ContactList)PIM.getInstance().openPIMList

          (PIM.CONTACT_LIST, PIM.READ_ONLY);

 Enumeration allContacts = blackBerryContactList.items("your search Name");
it will return only contacts list which will contain your searching Name.
Thanks and regards
Imran ali
Offline  
Old 07-07-2010, 04:00 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2010
Model: 8900
PIN: N/A
Carrier: telus
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi again,
Code:
Enumeration allContacts = blackBerryContactList.items("your search Name");
the above code has one problem,
it has been searching from all , like tiletle,company name, email etc form any field.
but i have to search in only First Name and Last Name.
for this i tried but i vein.
so if any one has solution please reply this thread.
Thanks
Imran ali
Offline  
Closed Thread


Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

4pcs EI-16 Multi-Impedance Audio Transformer 120K:600 ohm 30K:600 ohm e
$34.68
 4pcs EI-16 Multi-Impedance Audio Transformer 120K:600 ohm 30K:600 ohm e picture 4pcs EI-14 Audio Transformer 320:128 320:32ohm 320:2x32 ohm Multi-impedance e
$29.38
 4pcs EI-14 Audio Transformer 320:128 320:32ohm 320:2x32 ohm Multi-impedance e picture 4pcs EI-14 Audio Transformer 2.4k:2.4K 600:600 2.4K:600 ohm Multi-Impedance e
$30.38
 4pcs EI-14 Audio Transformer 2.4k:2.4K 600:600 2.4K:600 ohm Multi-Impedance e pictureRF DC BLOCK INNER, 50 Ohm Impedance, Type BNC MALE TO BNC FEMALE, 10 MHz
$16.95
RF DC BLOCK INNER, 50 Ohm Impedance, Type BNC MALE TO BNC FEMALE, 10 MHz  pictureElectro Scientific Industries 252 Impedance Meter
$175.0
Electro Scientific Industries 252 Impedance Meter   picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.