To set up your NetBeans IDE for Blackberry development, you need to add the
Blackberry JDE as a custom platform emulator because there are utilities distributed
with the JDE that are not distributed with its emulators.
The Bootstrap Libraries panel displays a long list of jar files. Select all
of the listed files except net_rim_api.jar and click Remove.
Click Next. Note: If the net_rim_api.jar is not in the
list, Click the Add button, and type in or navigate to C:\Program
Files\Research In Motion\blackberry JDE 4.1.0\lib\net_rim_api.jar
and click Open.
Then click Next.
In the Sources and JavaDoc panel, click the Add button next to the JavaDoc
window and type in or navigate to: C:\Program Files\Research In Motion\BlackBerry
JDE 4.1.0\docs\api\. The Java Platform Manager should look like the
following graphic:
Click Finish, then click Close.
Creating a Blackberry Project
Next, you create a project for your application:
Choose File > New Project.
Under Categories, choose Mobile. Under Projects, choose Mobile Application.
click Next.
Give the project a name, for example MobileApplication2.
If you do not want a sample MIDlet created for your project, uncheck the
"Create Hello MIDlet" check box.
Click Finish to create the Project.
Select the Files Tab in the Explorer window and open the project's build.xml
file. Add this fragment of code right before the </project> tag at the
bottom of the file:
If you would like to extend net.rim.device.api.ui.UiApplication
instead of standard MIDlets in your project, then:
Remove the highlighted argument line <arg value="-midlet"/>
from the build.xml script above.
Ignore the warnings in Project Properties / Application Descriptor / MIDlets
category when adding a class that does not extend MIDlet.
The code in the Source Editor window should look like this:
Set the Blackberry as the Default Device Emulator
Now you're ready to set the default configuration to emulate a Blackberry
device:
Right-click on the project and choose Properties.
In the Platform Properties:
Choose Blackberry 4.1 from the Emulator Platform drop-down menu.
Choose the Blackberry device emulator from the Device drop-down menu.
At this point, you are ready to write code, build, run, execute, and debug
your MIDlet for the BlackBerry.
In your project, you still have the freedom to use various platforms for different
project configurations. You can work around the limitation of one device per
one custom platform by repeating the steps in Adding RIM as
a Custom Emulator with an alternative platform name.
Note: Once you build your project and the emulator launches,
you will need to scroll to the icon for your application, which will be on the
main phone screen when the emulator comes up. You can use the arrow keys or
click the scroll wheel on the emulator image to navigate to your application
icon.