Você está na página 1de 20

Setting up Blackberry development

environment using NetBeans/JDE IDE


ADNAN FAKHAR
Table of Contents
Integrating BlackBerry (JDE) Emulator to NetBeans…………………………………………………….03
Developing Applications Using the JDE………………………………………………………………………..04
How to remove applications from BlackBerry Simulator………………………………………………13
How to Install 3rd Party Applications on BlackBerry Device………………………………………….14
How to include external (jar) file……………………………………………………………………………….…18
Running Existing MIDlets on the BlackBerry....................................................................19
Attentive Points...............................................................................................................20

2|Page
Integrating BlackBerry (JDE) Emulator to NetBeans

1. Right Click on my Java ME Project, and select the Properties


2. In the Category, select the Platform
3. Click on the Manage Emulators... Button shown which opens the Java PlatformManager window.
4. It shows the Platforms list, which doesn't show the BlackBerry platform for Java.
5. So Click on the Add Platform... Button provided, which opens the Add Java Platform window

6. Select 'Custom Java ME MIDP Platform Emulator'

8. Go to where you installed the JDE (e.g..: C:\Program Files\Research In


Motion\BlackBerry JDE 4.7.0) as the Platform Home

9. You can use RIM of 'Platform Name' and Blackberry as 'Device Name'
Click Next

10. In the Bootstrap Libraries list, remove everything except the


net_rim_api.jar file

11. Add the Blackberry javadocs path, for example: 'C:\Program


Files\Research In Motion\BlackBerry JDE 4.7.0\docs\api\' then click 'finish'

12. Close and then restart NetBeans.

3|Page
Developing Applications Using the JDE
This is BlackBerry JDE v4.6.0, default emulator is BlackBerry 9000 hand phone.

Open BlackBerry JDE.

4|Page
Create a workspace name: development.jdw

Create a project name: HelloWorldDemo.jdp

5|Page
Create a file name: HelloWorldDemo.java

After all the above steps done, you need to manually write a simple Hello World MIDlet. (If you are lazy to do so, you can
use NetBeans to generate a sample for you.)

Then, add in the project properties.

6|Page
It is because by default the project properties are empty.

7|Page
Build success.

After the code build complete, a HelloWorldDemo.cod file should located at C:\Program Files\Research In
Motion\BlackBerry JDE 4.6.0\simulator\ folder, this file is use by the simulator.

Now, I open BlackBerry Device Simulator.

8|Page
Click on Menu.

9|Page
Click on Downloads. The HelloWorldDemo application had been installed to this folder on the simulator.

10 | P a g e
Click on HelloWorldDemo application.

11 | P a g e
Done.

The tricky part of this BlackBerry JDE is that when I run my program, it won′t immediate open my program. It only install
all the COD files into the simulator & show me the default screen, I will need to manually go into the "Downloads" folder
to open my program. Quite a weird design. =.=

Other then using BlackBerry JDE, we can use NetBeans or Eclipse plug in as well.

12 | P a g e
How to remove applications from BlackBerry
Simulator
If you want to remove only selective application from Device Simulator then

 From "C:\Program Files\Research In Motion\BlackBerry JDE X.X.X\simulator"delete following files

 AppName.cod, AppName.cso, AppName.debug(and AppName-X.debug ,if exists), AppName.jar, and


four DMP files of related BB device like

 In case of Curve 8800--> 8800-as.dmp, 8800-nv.dmp, 8800-sdcard.dmp, 8800-fs.dmp.

 And if you want to remove all third party applications from Device Simulator then run "clean.bat", will
reset

 Your simulator to its initial state with no third party applications. "clean.bat" can be found in simulator
directory.

13 | P a g e
How to Install 3rd Party Applications on BlackBerry
Device

The Various File Types You Will Encounter

 .JAD files: An application descriptor that stores information about the application itself and the location of .COD
files
 .JAR files: a JAR file (or Java ARchive) is used for aggregating many files into one. It is generally used to distribute
Java classes and associated metadata.
 .COD files: A COD file is a proprietary file format developed by RIM that contains compiled and packaged
application code.
 .ALX files: Similar to the .JAD file, in that it holds information about where the installation files for the
application are located

Installing Third Party Software OTA (Over The Air)

Performing the OTA download and installation of a third party application is usually the easiest option. Most
application developers will provide direct links to the .jad or .jar files required for internal installation on your
BlackBerry. There is usually a second option for download to your desktop and installation via the BlackBerry
Desktop Manager. The Desktop Manager installation process is described in the next section.

Downloading OTA is super easy. Simply navigate to the download page for the application you wish to install
and find the direct (OTA) download link. From within the BlackBerry browser menu, select “Get Link” and then
click OK for each step of the installation. Here are the steps you must perform in order to download a third
party application OTA to your BlackBerry:

1. Navigate with the BlackBerry Browser to the desired application download page.
Example: Google Maps Mobile
2. Often you will be presented with a link to the download, or the option to enter your cellular phone number and
have the link sent to your device via SMS.
3. Follow the supplied link (either direct or SMS) from within your BlackBerry Browser and follow all the
instructions that appear on your screen.
4. The new application will be unpacked and installed by your BlackBerry Browser and your new software will be
now be available in your applications list.

NOTE: If you are using your BlackBerry in a BES configuration which is overseen by your IT department, you
may not have the ability to install your own third party applications to your device. If this is the case, you will
have to contact your IT professional and request that they add the software and deploy it to your device. This

14 | P a g e
may be against the policy that your employer has dictated so it is best to get approval before any such
request.

Installing Third Party Software Via BlackBerry Desktop Manager


Requirements :

 BlackBerry Desktop Manager


 Device software (Operating System) should be installed on PC. It should be the same Operating System that is
installed in BlackBerry device.

The second method of installation uses the RIM Desktop Manager. Applications meant to be installed
from the Desktop Manager come with two files: an ALX file and a COD file. First, connect your
BlackBerry to your PC using a data cable. Once the device is attached, launch the RIM Desktop
Manager. Then launch the Application Loader from inside the Desktop Manager.

 BlackBerry Desktop Manager

 Click the “Add…” button in the Application Loader and specify an Application Loader File(.alx). The
application should now appear in the list of items to install. Follow the instructions from there to finish
the installation and it should appear on your Blackberry.

 Piece o cake. Unless it didn’t work. If you hit a problem fear not. There are things you can do.

15 | P a g e
“No System Software was found for your handheld.”

No System Software Found

 Lucky you. You’ve either upgraded your handheld OS, or gotten a new BlackBerry for your birthday.
Either way, your Desktop Manager doesn’t know how to talk to your BlackBerry. It is lacking the device
software for your model of BlackBerry.

 You’ll have to download and install the latest device software and service packs from your carrier. To
see which device software you have installed on your computer, go to the Desktop Manager Help–
>About and click the Device Software tab.

 
“No additional applications for your handheld were found”

16 | P a g e
No Additional Applications

 First, make sure the .alx file and the .cod file are in the same directory. The Application Loader uses
both files to install to your BlackBerry. If that isn’t the problem, then upgrading the Desktop Manager
might help. You can download the latest version from your carrier or directly from RIM:
http://www.blackberry.com/support. More detailed information on this can be found at: BlackBerry
Install Error: No additional applications designed for your device found!

Invalid Digital Signature

 If you are running a BES BlackBerry, there is a setting in the BES that doesn’t allow the installation of
3rd party applications unless they have been signed. You will have to contact your BES administrator to
change this setting.

A fatal error has occurred while updating your handheld’s software. Please try again. Unspecified
error encountered [J:0×0000000A]

 That (most helpful) error message appears because the application you are loading requires a more
recent version of the handheld operating system than you have. You will need to go to your carrier’s
website and download a more recent version of the OS.

Note: ALX does not needed if install via OTA it only required when installing via USB (desktop)

Note = BlackBerry does not support to install third party applications via blue tooth, the only two methods to install
applications are OTA and USB

17 | P a g e
How to include external jar file (LWUIT)
Very simple solution to run LWUIT application into Blackberry successfully without Any Error:

The process(I suppose you're on a NetBeans IDE...?):


1) Before using the LWUIT.jar file into your application you have to pre verify that. The command to run is:
D:\Program Files\Research In Motion\BlackBerry JDE 4.2.1\bin>preverify -classpath "D:\Program Files\Research In
Motion\BlackBerry JDE 4.2.1\lib\net_rim_api.jar"
"D:\NBProjects\LWUITDemo\dist\lib\LWUIT.jar"

2) Then you will get the following errors:


i) Error preverifying class com.sun.lwuit.SVGImage
VERIFIER ERROR com/sun/lwuit/SVGImage.drawImage(Lcom/sun/lwuit/Graphics;II)V
:
Cannot find class javax/microedition/m2g/ScalableImage
You have to delete that SVGImage.class file from LWUIT.jar because JDE failed to verify it for the above errors.

ii) Then again run that command & you again will get errors:
Error preverifying class com.sun.lwuit.animations.Transition3D
VERIFIER ERROR com/sun/lwuit/animations/Transition3D.initTransition()V:
Cannot find class javax/microedition/m3g/Node
And you have to also delete Transition3D.class, M3G.class & M3G$Callback.class files from LWUIT.jar because JDE failed
to verify them also.
iii) Then again run that command and it will able verify successfully without any message. When pre verifying, all pre
verified classes are saved in a subdirectory "output" by default into the JDE “bin� directory.

3) Now take that pre verified LWUIT.jar file and make your application. And after completing your project with your .jad
& .jar file make the .cod file with the following command:
D:\Program Files\Research In Motion\BlackBerry JDE 4.2.1\bin>rapc import="D:\Program Files\Research In
Motion\BlackBerry JDE 4.2.1\lib\net_rim_api.jar" codename="C:\Documents and
Settings\Susanta\Desktop\COD\COD\LWUITApps" -midlet " D:\NBProjects\LWUITApps\dist\LWUITApps.jad" "
D:\NBProjects\LWUITApps\dist\LWUITApps.jar"
(Where “import� path is the net_rim_api.jar path, �codename� path is the path where you want to make
the cod file with name then .jad file path & .jar file path)
And you will get the .cod file in the codename path & test it.

18 | P a g e
Running Existing MIDlets on the BlackBerry
To run a standard MIDlet on a Java-enabled BlackBerry device, you first need to convert the .jad and .jar files to
the .cod format, using the rapc command-line tool that comes with RIM's JDE. You'll find rapc in the bin directory
of your JDE installation. This command converts a MIDlet named LoginMIDlet:

rapc import="c:\BlackBerryJDE3.6\lib\net_rim_api.jar" codename=LoginMIDlet -midlet jad=LoginMIDlet.jad


LoginMIDlet.jar
 
You can load the resulting LoginMIDlet.cod file into your BlackBerry device from your desktop computer over a
USB cable. Use the javaloader command, which can also be found in the bin directory of your JDE installation. I
used this command to load LoginMIDlet.cod into my BlackBerry 7510:

javaloader -usb load LoginMIDlet.cod


 
Once the application is loaded into the BlackBerry, you can run it just as if it were a native application.

You can use javaloader to delete applications from the BlackBerry as well as to load them. This command will remove
LoginMIDlet.cod from the BlackBerry:

javaloader -usb erase -f LoginMIDlet.cod

19 | P a g e
Attentive Points
 To integrate jde plug in eclipse , eclipse version should be 3.4 and plugin will install in the same folder where
eclipse copied.
 After installing eclipse3.4.1 , eclipse needs signing keys to activate black beery project, and if u need a signing
key for black berry u need to purchase.
 Sometime Thumb.db (image) insert in compiled jar file like Zantel.jar and this cause problem running application
in BlackBerry Device, open it with WinRar , navigate to image folder and delete it.

For any query contact me at

velocitykhan@yahoo.com

Adnan Fakhar

20 | P a g e

Você também pode gostar