02-02-2012 03:39 AM
I am developing an application which integrates BBM. I need to display the complete list of contacts of the current BBM user.
I developed the app using normal BB SDK 5.0 and then added the BBM SDK1.2 jar file as external jar fiel in my project.
My Code: In the constructor of Uiapplication I pushed a screen and did the following code,
try {
platformContext = BBMPlatformManager.register(myPlugin);
} catch (ControlledAccessException e) {
// The BBM platform has been disabled
}
if (platformContext != null) {
MyBBMPlatformContextListener platformContextListener;
platformContextListener = new MyBBMPlatformContextListener();
platformContext.setListener(platformContextListene r);
}
On clicking the list button in the first screen another screen will be opened (In thi sscreen I am passing the object of platformContext) and used the following code.
ContactListService contactListService = platformContext
.getContactListService();
BBMPlatformContactList contacts = contactListService.getContactList();
Enumeration contactsEnum = contacts.getAll();
while (contactsEnum.hasMoreElements()) {
BBMPlatformContact contact = (BBMPlatformContact) contactsEnum
.nextElement();
add(new LabelField(contact.getDisplayName()));
}
When I am running the code on device, the screens are displyed perfectly but contacts was not there.
Please help me.
Thanks and Regards,
Meera Manesh
02-03-2012 10:11 AM
Hi!
Your question would be more likely to get a response in the Java forums here:
http://supportforums.blackberry.com/t5/Java-Develo
This forum is for BlackBerry Advertising Service support
Cheers
Jim