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
Eugen
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL
Accepted Solution

Get desktop address book contacts (BES) in app

Hi guys,

 

Is it as designed?

I've just found that this code

 

PIM pim = PIM.getInstance();
contacts = (BlackBerryContactList) pim
.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
en = contacts.items(BlackBerryContactList.SEARCH_CONTACTS);

 doesn't give me BES contacts from phone book.

 

Any workaround?

 

Thanks,

Eugen

Please use plain text.
Developer
simon_hain
Posts: 15,872
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get desktop address book contacts (BES) in app

use http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/pdap/BlackBerryContactList... net.rim.blackberry.api.pdap.RemoteLookupListener) to lookup contacts from the BES.
items only gives you your local address book.
----------------------------------------------------------
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
Eugen
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Get desktop address book contacts (BES) in app

Simon,

 

but they already in my phone book, just in another contact list (according to address book). Doesn't matter.

 

If you know answers (otherwise I would debug) - Does it allow regexp? Or I should lookup letter by letter? Or I could just pass empty string to get all contacts?

 

Thanks,

Eugen

Please use plain text.
Developer
simon_hain
Posts: 15,872
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get desktop address book contacts (BES) in app

i don't think regxp and empty string are supported by this method.

i don't know what you mean with "other contact list", maybe you can open it using http://www.blackberry.com/developers/docs/7.1.0api/javax/microedition/pim/PIM.html#openPIMList(int, int, java.lang.String) ?
never worked with it, so you have to try it on your own :smileyhappy:
----------------------------------------------------------
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
Eugen
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Get desktop address book contacts (BES) in app

Thanks a lot! Going to give a try to my debugger!

Please use plain text.
Developer
Eugen
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Get desktop address book contacts (BES) in app

Just found that it's going to network here. Which is not nice for me. Going further.

Please use plain text.
Developer
simon_hain
Posts: 15,872
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get desktop address book contacts (BES) in app

did you try the second suggestion to open the other address list by PIM?
----------------------------------------------------------
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
Eugen
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Get desktop address book contacts (BES) in app

Maybe I read javadoc wrong. I can pass only constant that represents type (CONTACT_LIST ). And doing this I got only contacts from phone book. 

Please use plain text.
Developer
simon_hain
Posts: 15,872
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Get desktop address book contacts (BES) in app

there is another signature for the method that allows to pass a string, the forum did not create the link above correctly.
----------------------------------------------------------
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.