Testing a BlackBerry device application with the BlackBerry Smartphone Simulator
Testing a
BlackBerry device
application that uses an HTTP connection
You can test applications that require an HTTP connection (for example,
email) by using
the
BlackBerry® MDS Connection Service.
Start the BlackBerry MDS Connection Service
when you start the BlackBerry Smartphone Simulator
- In Eclipse®, on the Run menu, click Debug Configurations or Run Configurations.
- Expand the BlackBerry Simulator
item.
- Complete one of the following tasks:
- To work with an existing launch configuration, under BlackBerry Simulator, click a launch configuration.
- To create a new launch configuration, right-click BlackBerry Simulator, select New.
- Click the Simulator tab.
- Click the General tab.
- Select the Launch Mobile Data System Connection Service (MDS-CS) with simulator check box.
- Click Apply.
Open a web site in the
BlackBerry Browser when the
BlackBerry Smartphone Simulator starts
-
In
Eclipse®, on the
Run menu, click
Debug Configurations or
Run Configurations.
-
Expand the
BlackBerry Simulator item.
-
Perform one of the following tasks:
- To work with an
existing launch configuration, under
BlackBerry Simulator, click a launch
configuration.
- To create a new
launch configuration, right-click
BlackBerry Simulator, select
New.
-
Click the
Simulator tab.
-
Click the
General tab.
-
Select the
Launch Mobile Data System Connection Service (MDS-CS) with
simulator check box.
-
In the
Launch app or URL on startup field, type the
web address.
-
Click
Close.
-
Click
Yes.
Start a
BlackBerry device
application when the
BlackBerry Smartphone Simulator starts
-
In
Eclipse®, on the
Run menu, click
Debug Configurations or
Run Configurations.
-
Perform one of the following tasks:
- To work with an
existing launch configuration, under
BlackBerry Simulator, click a launch
configuration.
- To create a new
launch configuration, right-click
BlackBerry Simulator, select
New.
-
Click the
Simulator tab.
-
Click the
General tab.
-
In the
Launch app or URL on startup field, type the
name of the .cod file of the application.
-
Click
Close.
-
Click
Yes.
View output from the BlackBerry Smartphone Simulator
- In Eclipse®, on the Window menu, click Show View > Console.
- In the Console view, select Display Selected Console.
- From the console drop-down list, click BlackBerry Simulator Console Output.
Add a BlackBerry
device application to the BlackBerry Smartphone Simulator launch configuration
- On the Run menu, click Debug Configurations or Run Configurations.
- Expand the BlackBerry Simulator
item.
- Perform one of the following tasks:
- To work with an existing configuration, under BlackBerry Simulator, click a configuration.
- To create a new configuration, right-click BlackBerry Simulator, and click New.
- Click the Projects tab.
- Click the BlackBerry® device application
that you want to add.
- Click Close.
- Click Yes.
Debug a BlackBerry device application on a BlackBerry Smartphone Simulator that is running
- On the Run menu, click Debug Configurations.
- Right-click Running BlackBerry Simulator, and click New.
- In the Name field, type a name.
- Click Debug.
Add a .jar file, that was created without using RAPC, to
the
BlackBerry Smartphone Simulator or
a
BlackBerry
device
When your
BlackBerry® application project imports a .jar
file that was created without using RAPC, you can add the .class files to your
BlackBerry
application project and install the .class files
in the
BlackBerry® Smartphone Simulator or
on a
BlackBerry device.
-
In the
Package Explorer view, right-click a
BlackBerry
application project.
-
Click
Properties.
-
Click
Java Build Path.
-
On the
Libraries tab, click
Add JARs or
Add External JARs.
-
Navigate to the .jar file that you want to add, and click
Open.
-
On the
Order and Export tab, select the .jar file and
click
OK.
-
Package the
BlackBerry
application project and run the application on the
BlackBerry Smartphone Simulator or theBlackBerry device.
The .class files are zipped into the .cod file of the
BlackBerry
application project and installed on the
BlackBerry Smartphone Simulator or on a BlackBerry device.
Run a MIDlet application in the
BlackBerry Smartphone Simulator
You can import a MIDlet .jar file into a
BlackBerry® application project and run the MIDlet application in the
BlackBerry® Smartphone Simulator. You can import only one MIDlet .jar file into the
BlackBerry
application project.
You must manually add any dependent library (.cod) files to the
BlackBerry Smartphone Simulator.
Before you begin:
You must have a .jad and .jar file pair to add to the
BlackBerry
application project.
-
Create a new
BlackBerry
application project, and add the .jad and .jar files to the project.
Do not place the files in a source folder.
-
In the
Package Explorer view, right-click the
BlackBerry
application project.
-
Click
Properties.
-
Click
Java Build Path.
-
On the
Libraries tab, click Add JARs or Add External JARs.
-
Navigate to the MIDlet .jar file that you want to add and click
Open.
-
On the
Order and Export tab, select the MIDlet .jar file
and click
OK.
- Package the
BlackBerry
application project and run the application in the
BlackBerry Smartphone Simulator. The .class files are zipped into the .cod file of the
BlackBerry
application project and added to the
BlackBerry Smartphone Simulator.
Hot-swap a
BlackBerry device application
Before you begin:
You must install the
BlackBerry® Java® SDK 5.0 or
later on your computer.
-
In
Eclipse® right-click a
BlackBerry application project.
-
Complete one of the following tasks:
- Click
Run As > BlackBerry Simulator.
- Click
Debug As > BlackBerry Simulator.
-
In the
BlackBerry® Smartphone Simulator, click
the icon to run the application.
-
In
Eclipse, make changes to the application that
is running. Save the changes.
-
Complete one of the following tasks:
- On the
Run menu, click
Run As > BlackBerry Simulator.
- On the
Run menu, click
Debug As > BlackBerry Simulator.
The changes to the
BlackBerry device application appear
in the
BlackBerry Smartphone Simulator.
Restore the default settings for the
BlackBerry Smartphone Simulator
-
On the
BlackBerry menu, click
Clean Simulator.
-
Expand the
BlackBerry®
JRE™ that you want to restore the default
settings for.
-
Select the appropriate check boxes.
-
Click
OK.
Set preferences for running a
BlackBerry device application in debug
mode
-
On the
Window menu, click
Preferences.
-
Expand
BlackBerry Java Plug-in.
-
Click
Debug.
-
In the
Warning section, select the
Prompt for missing debug files check box if
you want to be notified about missing files.
-
Click
Apply.
-
Click
OK.
Was this information helpful? Send us your comments.