Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

ContactList.item("string")

hi all, 

 

i hv 1400 contacts stored in my address book. now whenever i try to find any contact with specified string using function ContactList.item(str), it takes much time.

 

suppose to find contact with name Blackberry, i fire ContactList.item('Blackberry') which is taking approx. 9-10 sec on simulator and 13-14 sec on 8100

 

i dont know whether its my fault or the any problem of BB API function ContactList.item(str).

 

pls advise  

Jeet Bhatt, India
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: ContactList.item("string")

the implementation is slow, it is not your fault.
if you want to know why the native phone application can look up names very fast: don't ask me, i wish i knew why RIM does not offer the used method.

the only solution i can think of is to read the addressbook into your own data structure in a background thread. maybe you can store the structure persistant and change it only when PIMListListener fires.
you will have to re-implement a persistable blackberrycontact and write a wrapper to read an existing contact into your new one (i have done this already, but never found the time to build a fast indexing structure around it).
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: ContactList.item("string")

MSohm, can u please guide us?
Jeet Bhatt, India
Please use plain text.
Developer
02cp682
Posts: 80
Registered: ‎08-26-2008
My Device: 8800, 8100

Re: ContactList.item("string")

 

simon,
it seems that to read addressbook in our own data structure will also not solve the performance issue, if i implement Hashtable, then it would be difficult to maintain indexing in terms of fast execution since i have so many contacts. 

 

 

Jeet Bhatt, India
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: ContactList.item("string")

implementing a fast indexing data structure on j2me would be a typical topic in university. you don't have to use Hashtable.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.