05-30-2012 04:58 AM
Hey,
I'm trying to make a remote search on a blackberry BES server, but the 'RemoteLookupListener' isn't getting a response on 'items()';
The built in BB Remote Contact Lookup is working fine if you wonder..
Thanks, Rotem
Solved! Go to Solution.
05-30-2012 10:44 AM
Hi Rotem,
The code is working fine for me, it returned 94 found contacts.
Are you testing on a real device or simulator?
What is the device model and software version?
What SDK version are you using to compile?
Regards,
05-31-2012 04:28 AM
Hi,
I'm testing it on my device not on a simulator. (Bold 9900 OS 7.1)
I'm using BlackBerry Java Plug-in for Eclipse:
Thanks,
Rotem
05-31-2012 07:07 AM
What's the full OS version on your device (ex 7.1.0.123)?
Do you have another device active on the same BES that you could test this against?
05-31-2012 07:24 AM
7.1.0.342(1149), Is there any known issues with that version?
Lucky me - I'm working at a cellular opeartor so I'll test it with another devices (Bold 9700/9780),
It will take some time to do the enterprise activition so I'll update you after I'm done..
Altough I realy want to use it on my personal device.
Thanks,
Rotem
05-31-2012 09:39 AM
OK, it is very strange..
I tried the app. on Bold 9780 and it worked, then I installed it again on my device and it also worked (altough it showed another number of contacts found..)
Any way,
I added a few things to the items method and it isn't working again..
May you take a look?
public void items(Enumeration results)
{
int count = 0;
String names = "";
while (results.hasMoreElements())
{
Contact con = (Contact) results;
names += con.getString(Contact.NAME, 0);
names += "\n";
results.nextElement();
++count;
}
cntFld.setText("Number of Contacts: " + count + "\n" + names);
}
Thanks again,
Rotem
05-31-2012 09:42 AM
You can't cast an Enumeration directly into a Contact object:
Contact con = (Contact) results;
You will need to iterate through:
Contact con = (Contact) results.nextElement();
05-31-2012 11:30 AM
OK,
What about this code?
http://codeviewer.org/view/code:26ba
I fixed the cast issue, but still not working..
I'm realy lost..
Thanks,
Rotem
05-31-2012 11:34 AM
Hi Rotem,
Try it on the device that was working previously, if it works there then the code should be fine. It sounds like you may have a strange environment issue.
06-04-2012 02:34 AM
Hey,
The lookup is now working just fine!
I have a few more questions:
1. Is it possible to look for a BES contact by it's phone number?
2. Is it possible to get contact's picture from Active Directory if it's connected to the BES?
Thanks,
Rotem