如何将 BlackBerry BBM SDK 集成到现有的 Java 项目中?

发布于 2024-12-11 03:03:11 字数 1333 浏览 0 评论 0原文

我正在尝试将 BBM 库集成到我编写的现有应用程序中。基本上我只是希望用户能够通过 BBM 向其他人发送邀请链接。所以我需要它做的就是使用预先填充的消息调用 BBM。

基本上,我最初将应用程序编写为 midlet,并使用 J2ME Polish 进行样式设计。事实上,它在我测试过的黑莓设备上运行得很好。但我想尝试集成 BBM 库,这就是事情变得奇怪的地方。

我最初使用 NetBeans 作为 IDE,并使用 Ant 脚本来构建项目。我第一次尝试通过 Ant 构建脚本包含 BBM SDK 导致了预验证错误。基本上这个预验证错误:

Error preverifying class net.rim.blackberry.api.bbm.platform.ui.chat.component.SmileyScreen

java/lang/NoClassDefFoundError: net/rim/device/api/ui/component/TextInputDialog

我最终设法拼凑出一些似乎包含图书馆的系统。有点儿。我可以包含一些类,例如 BBMPlatformManager、BBMPlatformContext 和 BBMPlatformApplication,并且它会成功构建。

但是当我尝试扩展一个类时,例如 private class MyBBMAppPlugin extends BBMPlatformApplication 然后我收到一个预验证错误,提示 java/lang/NoClassDefFoundError: net/rim/blackberry/api/bbm/platform/BBMPlatformApplication

所以我尝试看看是否可以找到解决办法。

我尝试创建 BBMPlatformApplication 的实例。但是,如果我尝试使用以下行注册它:

platformContext = BBMPlatformManager.register(myPlugin);

然后应用程序在启动时崩溃,并显示错误消息“验证错误 2923 at offset 6405

如果我删除该行,它就不会崩溃。

从那里我什至尝试使用 BlackBerry 插件将 IDE 切换到 Eclipse。创建了一个新的 BlackBerry 应用程序并导入 但现在,如果我尝试通过BlackBerry

-> 包构建它,我会收到一条错误消息:

“打包项目...”期间发生内部错误。 java.lang.NullPointerException

我仍然可以使用 Ant 脚本进行构建,但是当我这样做时,它找不到 BBM 库。

所以现在我完全迷失了,不知道下一步该尝试什么。我尝试过的每条路似乎都是死胡同,我不知道下一步该往哪里走。

有什么想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文