I'm trying to integrate the BBM library into an already existing app that I wrote. Basically I just want users to be able to send an invite link to other people via BBM. So all I need it to do is call up BBM with a pre-populated message.
Basically, I originally wrote the app as a midlet and used J2ME Polish to do the styling. As is, it works just fine on the BlackBerry devices I've tested. But I want to try and integrate the BBM library and this is where things get weird.
I was originally using NetBeans as my IDE and using Ant scripts to build the project. My first attempts to include the BBM SDK via the Ant build script resulted in preverification errors. Basically this preverification error:
Error preverifying class net.rim.blackberry.api.bbm.platform.ui.chat.component.SmileyScreen
java/lang/NoClassDefFoundError: net/rim/device/api/ui/component/TextInputDialog
I eventually managed to cobble together some system that seems to include the library. Kind of. I can include some of the classes such as BBMPlatformManager, BBMPlatformContext and BBMPlatformApplication and it builds sucessfully.
But when I try to extend a class, such as private class MyBBMAppPlugin extends BBMPlatformApplication then I get a preverification error saying java/lang/NoClassDefFoundError: net/rim/blackberry/api/bbm/platform/BBMPlatformApplication
So I tried to see if I can find a way around that.
I tried just creating an instance of BBMPlatformApplication. But if I try to register it with the following line:
platformContext = BBMPlatformManager.register(myPlugin);
Then the app crashes at startup with the error message "verification error 2923 at offset 6405
If I remove that line, it doesn't crash.
From there I even tried switching IDEs to Eclipse with the BlackBerry plugin. Created a new BlackBerry application and imported the library as per the setup instructions.
But now, if I try building it via BlackBerry -> package, I get an error saying:
An internal error occurred during: "Packaging projects...". java.lang.NullPointerException
I can still build using my Ant script, but when I do that it can't find the BBM libraries.
So now I'm completely lost and don't know what to try next. Every path I've tried seems to have been a dead end and I have no idea where to go next.
Any thoughts?