当前位置: 代码迷 >> BlackBerry >> Blackberry 下怎么使用第三方 Library (jar)
  详细解决方案

Blackberry 下怎么使用第三方 Library (jar)

热度:2036   发布时间:2013-02-26 00:00:00.0
Blackberry 上如何使用第三方 Library (jar)
关于黑莓上如何使用第三方jar包的问题,折腾我好几天了。下面是我从黑莓官方网站上直接copy下来的,这种方法我测试过了。下面的描述是基于BB自己的IDE操作的,Eclipse上没有试过。

如有任何问题可以留言联系我,我尽量帮你们解答。


Article Number: DB-00042
Summary
This article applies to the following:

BlackBerry? wireless devices based on Java?
BlackBerry Java Development Environment (JDE)

Details
You can include classes from other compiled JAR files in your application. To include these files, save the JAR file in a new project in the same workspace as your application. Make this new project a library application and make your application dependent on this library. You can then import all of its classes. The following steps make up this procedure.

To create a new project

Open the workspace that contains your application's project.
Create a new project.
To add a compiled JAR file to the project

In the navigation pane, select the project.
On the Build menu, select Project > Add File to Project.
Select the appropriate JAR file and click Open.
To make the project a library

In the navigation pane, select the project.
Right-click and select Properties. The <Project name> Class Properties window appears.
Click the Application tab.
From the Project Type drop-down list, select Library.
To compile the project

In the navigation pane, select the project.
Right-click and click Build Project.
To make the project dependent on the new library

In the navigation pane, select the project.
Right-click and click Project Dependencies. The Class depends on <Project name:> window appears.
Select the <Project name> check box.

重启下IDE后
Your application can now import the classes in this JAR file with the import “xxx.yyy.*” command.







1 楼 女巫の微笑 2010-05-21  
用黑莓的插件,就不能再加第三方的包了,这些方法我都试了,没用
2 楼 wuhua 2011-09-21  
最近也碰到类似的问题,非常的纠结啊。
3 楼 REALGODO 2012-04-27  
目前在移植一个Midlet项目到blackberry的时候也遇到了类似的问题,目前还在纠结之中
  相关解决方案