You are on page 1of 51

BlackBerry Smartphone Simulator

Version: 4.7

Development Guide
SWD-614606-0210105609-001
Contents
1 Overview....................................................................................................................................................................................... 4
Changing configuration options................................................................................................................................................... 4
Managing BlackBerry device profiles........................................................................................................................................... 4
Create a BlackBerry device profile....................................................................................................................................... 4
Edit a BlackBerry device profile............................................................................................................................................ 5
Copy a BlackBerry device profile.......................................................................................................................................... 5
Rename a BlackBerry device profile..................................................................................................................................... 5
Delete a BlackBerry device profile....................................................................................................................................... 5
Starting the BlackBerry Smartphone Simulator.......................................................................................................................... 6
Start the BlackBerry Smartphone Simulator from the BlackBerry Smartphone Simulator launcher........................... 6
Start the BlackBerry Smartphone Simulator from the BlackBerry JDE............................................................................ 6
Start the BlackBerry Smartphone Simulator from a Simulator Package......................................................................... 6
Start the BlackBerry Smartphone Simulator from the command prompt....................................................................... 6
Start the BlackBerry Smartphone Simulator and open a web page................................................................................. 6
Redirect debug messages to a specified file....................................................................................................................... 6
Changing BlackBerry Smartphone Simulator display options................................................................................................... 7
Show or hide the faceplate.................................................................................................................................................... 7
Display the device in full-screen mode................................................................................................................................ 7
Magnify the BlackBerry device image................................................................................................................................. 7
Capturing screen shots.................................................................................................................................................................. 7
Save a screen shot.................................................................................................................................................................. 8
Copy a screen shot to the clipboard..................................................................................................................................... 8

2 Using the BlackBerry Smartphone Simulator......................................................................................................................... 9


Simulating BlackBerry device interaction.................................................................................................................................... 9
Click the screen...................................................................................................................................................................... 9
Touch the screen.................................................................................................................................................................... 9
Perform simultaneous screen touches................................................................................................................................. 9
Changing the BlackBerry device orientation...................................................................................................................... 9
Change screen orientation.................................................................................................................................................... 10
Use the trackball.................................................................................................................................................................... 10
Simulating convenience keys................................................................................................................................................ 11
Simulating convenience keys................................................................................................................................................ 11
Assign a key to the Escape key............................................................................................................................................. 11
Use the trackwheel and keys................................................................................................................................................ 11
BlackBerry Device Software applications..................................................................................................................................... 12
Use the contact list................................................................................................................................................................ 12
Use the calendar.................................................................................................................................................................... 13
Compose an email.................................................................................................................................................................. 13
Simulate an incoming call..................................................................................................................................................... 13
Simulate an outgoing call...................................................................................................................................................... 14
Using voice activated dialing................................................................................................................................................ 14
Use the touch screen............................................................................................................................................................. 15
Use text messaging................................................................................................................................................................ 15
Using the camera................................................................................................................................................................... 16
Recording video...................................................................................................................................................................... 17
Simulate a GPS receiver........................................................................................................................................................ 18
Simulating GPS location information.................................................................................................................................. 18
Managing GPS routes............................................................................................................................................................ 19
Changing BlackBerry device operating conditions..................................................................................................................... 21
Use a single button headset................................................................................................................................................. 21
Use a multiple button headset............................................................................................................................................. 22
Disconnect a headset............................................................................................................................................................. 22
Change holster conditions.................................................................................................................................................... 22
Use a flip device..................................................................................................................................................................... 22
Simulate battery conditions.................................................................................................................................................. 22
Simulate the absence of a SIM card..................................................................................................................................... 23
Simulating network conditions............................................................................................................................................. 23
Simulate supplementary services......................................................................................................................................... 24
Reset the flash memory......................................................................................................................................................... 24
Simulating flash memory....................................................................................................................................................... 24
Simulating a media card........................................................................................................................................................ 25
Simulating a computer connection...................................................................................................................................... 26
Simulating BlackBerry Enterprise Server APIs and IT policies.......................................................................................... 26
Using the BlackBerry Smartphone Simulator in secure mode.......................................................................................... 26
View the event log.................................................................................................................................................................. 27

3 Testing applications using the BlackBerry Smartphone Simulator..................................................................................... 28


Testing GPS applications............................................................................................................................................................... 28
Test MIDlets..................................................................................................................................................................................... 28
Testing applications that require an HTTP connection.............................................................................................................. 28
Start the BlackBerry MDS Simulator and verify that it is running.................................................................................... 29
Connecting the BlackBerry Smartphone Simulator to BlackBerry Enterprise Server or a BlackBerry MDS Simulator
on the same computer........................................................................................................................................................... 29
Configuring the BlackBerry MDS Simulator simulator...................................................................................................... 29
Testing push applications...................................................................................................................................................... 33
Testing messaging applications.................................................................................................................................................... 34
Configure a POP3 and SMTP server connection................................................................................................................ 35
Send a message...................................................................................................................................................................... 35
Receive a message................................................................................................................................................................. 35
Testing BlackBerry Enterprise Server APIs and IT policies......................................................................................................... 36
Test a BlackBerry Smartphone Simulator with a BlackBerry Enterprise Server.............................................................. 36

4 Using the BlackBerry Smartphone Simulator programmatically......................................................................................... 37


Start the BlackBerry Smartphone Simulator controller.............................................................................................................. 37
Send commands to the BlackBerry Smartphone Simulator....................................................................................................... 38
Exit the BlackBerry Smartphone Simulator controller session.................................................................................................. 38
Using test scripts............................................................................................................................................................................ 39
Test BlackBerry Smartphone Simulator events using script............................................................................................. 39
Use BlackBerry Smartphone Simulator controller commands.................................................................................................. 40
Behavior and appearance commands.................................................................................................................................. 41
Location commands............................................................................................................................................................... 42
Keyboard and event commands........................................................................................................................................... 42
Data and phone commands.................................................................................................................................................. 44
BlackBerry device accessory commands............................................................................................................................. 44

5 Provide feedback......................................................................................................................................................................... 46

6 Legal notice.................................................................................................................................................................................. 47
Development Guide Overview

Overview 1
The BlackBerry® Smartphone Simulator enables you to run BlackBerry device applications on your computer.
The BlackBerry Smartphone Simulator includes the BlackBerry device applications that are typically available on BlackBerry
devices and enables you to load and test your own applications. You can simulate and test various connectivity and state changes
using the BlackBerry Smartphone Simulator. When you use the BlackBerry Smartphone Simulator to perform testing, you might
need to simulate additional BlackBerry services. The BlackBerry MDS Simulator and the BlackBerry Email Simulator are available
for this purpose.

Changing configuration options


By default, after you specify the BlackBerry® device model, the BlackBerry Smartphone Simulator runs using the configuration
options that are typical for that BlackBerry device. However, you can manually set or change many of the configuration options,
such as the screen size, the communication port numbers, and the locale.

Configuration method Description


From the BlackBerry® Integrated You can configure many of the simulator options from the BlackBerry IDE interface
Development Environment (BlackBerry and save them as a new device simulator profile. See the BlackBerry Integrated
IDE) Development Environment Online Help for more information about setting and
saving BlackBerry Smartphone Simulator options using the BlackBerry IDE.
From the command prompt You can use command prompt options to set how the BlackBerry Smartphone
Simulator operates. At the command prompt, type fledge /help.

Managing BlackBerry device profiles

Create a BlackBerry device profile


1. In the BlackBerry® Smartphone Simulator, double-click the fledgelauncher.exe file.
2. In the drop-down list, select Create a new simulator profile.
3. In the Software version drop-down list, select the software version.
4. In the Handheld model drop-down list, select the BlackBerry® device you want to use.
5. In the Profile name field, type a name for this profile.
6. Click Configure.

4
Development Guide Managing BlackBerry device profiles

7. In the Edit simulator profile dialog box, on the Hardware tab, specify the hardware settings for this BlackBerry Smartphone
Simulator.
8. On the Network tab, specify the network settings.
9. On the Advanced tab, specify advanced settings such as LCD timeout, and add command line arguments for the BlackBerry
Smartphone Simulator.
10. Click OK.

Edit a BlackBerry device profile


1. In the BlackBerry® Smartphone Simulator directory, double-click the fledgelauncher.exe file.
2. In the drop-down list, select Manage existing simulator profiles.
3. In the Profile list, select the profile you want to edit.
4. Click Edit.
5. In the Edit simulator profile dialog box, change the settings.
6. Click OK.

Copy a BlackBerry device profile


1. In the BlackBerry® Smartphone Simulator directory, double-click the fledgelauncher.exe file.
2. In the drop-down list, select Manage existing simulator profiles.
3. In the Profile list, select the profile you want to copy.
4. Click Copy.

Rename a BlackBerry device profile


1. In the BlackBerry® Smartphone Simulator directory, double-click the fledgelauncher.exe file.
2. In the drop-down list, select Manage existing simulator profiles.
3. In the Profile list, select the profile you want to copy.
4. Click Rename.
5. Type a new name.
6. Press Enter.

Delete a BlackBerry device profile


1. In the BlackBerry® Smartphone Simulator directory, double-click the fledgelauncher.exe file.
2. In the drop-down list, select Manage existing simulator profiles.

5
Development Guide Starting the BlackBerry Smartphone Simulator

3. In the Profile list, select the profile you want to delete.


4. Click Delete.

Starting the BlackBerry Smartphone Simulator


The BlackBerry® Smartphone Simulator is available either as a part of the BlackBerry® Java® Development Environment or as a
standalone installation of the BlackBerry simulator package. Visit www.blackberry.com/developers on page for more information
about downloading the BlackBerry Smartphone Simulator.

Start the BlackBerry Smartphone Simulator from the BlackBerry Smartphone Simulator
launcher
1. In the BlackBerry® Smartphone Simulator directory, launch fledgelauncher.exe.
2. In the drop-down list, select Launch a simulator.
3. In the Profile list, select the profile.
4. Click Go.

Start the BlackBerry Smartphone Simulator from the BlackBerry JDE


On the taskbar, click Start --> Programs --> Research In Motion --> BlackBerry JDE 4.7.x --> Device Simulator

Start the BlackBerry Smartphone Simulator from a Simulator Package


On the taskbar, click Start --> Programs --> Research In Motion --> BlackBerry Smartphone Simulators 4.3.x -->
Device Simulators 4.3.x --> device_name.

Start the BlackBerry Smartphone Simulator from the command prompt


At the command prompt, type:
fledge /handheld=<model_number>

Start the BlackBerry Smartphone Simulator and open a web page


At the command prompt, type:
fledge /handheld=<model_number> /app-param=url:<URL> /app=jvm.dll

Redirect debug messages to a specified file


At the command prompt, type:

6
Development Guide Changing BlackBerry Smartphone Simulator display options

fledge /handheld=<model_number> /app-param=JvmDebugFile:<file_name>

Changing BlackBerry Smartphone Simulator display options

Show or hide the faceplate


By default, the BlackBerry® Smartphone Simulator displays the BlackBerry device faceplate. You can hide the faceplate so that
only the screen is visible.
On the View menu, click LCD Only.

Display the device in full-screen mode


Full-screen mode allows you to maximize the view of the BlackBerry® Smartphone Simulator. You can view either the full
BlackBerry device faceplate or only the screen in full-screen mode. Since the BlackBerry Smartphone Simulator only uses integral
multiples of the simulated screen resolution, different screen resolution settings may result in full-screen images that cover a
larger percentage of the computer screen.
If you are viewing the LCD screen in full-screen mode, the LCD screen stretches to its optimal zoom-level and is padded with a
black background. If you view the BlackBerry device image in full-screen mode, the BlackBerry device image is centered and is
padded with a white background.

1. On the View menu, click Full Screen.


2. To access menu options, move the mouse to the top of the computer screen. The menu appears when the cursor is near the
top of the screen.
3. To exit full-screen mode, on the View menu, click Full Screen.

Magnify the BlackBerry device image


The percentage value determines the pixel-to-pixel ratio between the simulated LCD screen and the computer screen. For
example, at 200 percent zoom level, 4 pixels on the monitor display 1 pixel of the simulated LCD screen.
1. On the View menu, click Zoom.
2. Click a percentage.
3. On the View menu, click Smooth Magnified LCD.

Capturing screen shots


The BlackBerry® Smartphone Simulator can save an image of the BlackBerry device that you simulate including the faceplate,
or the screen only.

7
Development Guide Capturing screen shots

By default, the BlackBerry Smartphone Simulator saves the screen shot as the most suitable file type for the content of the image.
The BlackBerry Smartphone Simulator saves a screen shot of the BlackBerry device image as a .jpg file, and a screen shot of the
LCD as a .png file. You can override the default if you click Browse and set a different file type in the Save as type field.

Save a screen shot


On the Edit menu, click Save Device Snapshot or Save LCD Snapshot.

Copy a screen shot to the clipboard


On the Edit menu, click Copy Device Snapshot or Copy LCD Snapshot.

8
Development Guide Using the BlackBerry Smartphone Simulator

Using the BlackBerry Smartphone Simulator 2

Simulating BlackBerry device interaction

Click the screen


Use the BlackBerry® Smartphone Simulator to simulate a screen click.
Click the left mouse button anywhere within the device screen area.

Touch the screen


Use the BlackBerry® Smartphone Simulator to simulate a screen touch.

Click the right mouse button anywhere within the device screen area.

Perform simultaneous screen touches


Use the BlackBerry® Smartphone Simulator to simulate multiple screen touches at the same time.
1. On the Simulate menu, click Multitouch Mode.
2. Click and drag using either the left or right mouse buttons anywhere within the device screen area.
3. Perform the same action elsewhere on the screen to complete the multitouch action.
After you complete the second touch, both touches are simulated as if they started at the same time.

Changing the BlackBerry device orientation


BlackBerry® Storm™ 9500 smartphones support displaying screen information in either landscape or portrait mode, depending
on how the physical device is oriented.

Orientation mode Description


Top-Side-Up The device is oriented normally.
Left-Side-Up The device is rotated 90 degrees to the right.
Right-Side-Up The device is rotated 90 degrees to the left.
Bottom-Side-Up The device is rotated 180 degrees, upside-down.
Front-Side-Up The device screen is facing upward.

9
Development Guide Simulating BlackBerry device interaction

Orientation mode Description


Back-Side-Up The device screen is facing downward.

Change screen orientation


Use the BlackBerry® Smartphone Simulator to simulate a screen orientation change.
1. On the Simulate menu, click Tilt BlackBerry.
2. Select an orientation mode for the BlackBerry® screen.

Use the trackball


Use the BlackBerry® Smartphone Simulator trackball to simulate using the trackball on a BlackBerry® device.
• To navigate between fields, icons, and menu items, roll the trackball.
• To select a field or a menu item, click the trackball.
BlackBerry Smartphone Simulator for BlackBerry devices that support the trackball assign the BlackBerry Wireless Handheld
keyboard and mouse actions to the following BlackBerry Wireless Handheld functionality:

Task Keyboard steps Mouse steps with trackball Mouse steps with trackball
mode on mode off
Turn trackball mode on or off. Press F12. 1.On the Edit menu, click 1. On the Edit menu, click
Map Middle Mouse Button Map Middle Mouse
--> Toggle Trackball Mode. Button --> Toggle
2.Click the middle mouse Trackball Mode.
button. 2. Click the middle mouse
button.
Click the trackball. Press F9. Click the left mouse button. Click the middle mouse
button on the trackball.
Roll the trackball. Press the arrow keys. Move the mouse. Click and drag the mouse on
the trackball.
Press the Escape button. Press ESC. Click the right mouse button. Click the right mouse button
on the trackball.

Note: Rolling the mouse wheel generates trackwheel rolls not trackball rolls. Although the BlackBerry Smartphone Simulator
will appear to be receiving trackball rolls, it is actually a trackwheel event.

10
Development Guide Simulating BlackBerry device interaction

Simulating convenience keys


Some BlackBerry® smartphones contain additional keys that are not present on other BlackBerry models. The BlackBerry
Smartphone Simulator assigns the device keys to the following computer keyboard procedures:

Active Key Steps


Front Convenience key Press Insert.
Side Convenience key Press PAGE UP.
Currency symbol key (BlackBerry® 8700 Series only) Press F5.
Speaker phone key (BlackBerry® 8700 Series only) Press F6.

Simulating convenience keys


Some BlackBerry® smartphones contain additional keys that are not present on other BlackBerry models. The BlackBerry
Smartphone Simulator assigns the device keys to the following computer keyboard procedures:

Active Key Steps


Menu key Press Insert.
Right Side Convenience key Press \.
Left Side Convenience key Press PAGE UP.
Volume Up key Press F8
Volume Down key Press F7.

Assign a key to the Escape key


BlackBerry® Smartphone Simulator for BlackBerry® devices that do not support the trackball enable you to map the cursor key
to the Escape key.
1. On the Edit menu, click Map Cursor Key to Escape.
2. Select Left or Right.

Use the trackwheel and keys


Use the BlackBerry® Smartphone Simulator trackwheel to simulate using the trackwheel on a BlackBerry® device. Note that not
all BlackBerry devices use the keys listed.
• To navigate between fields, icons, and menu items, roll the trackwheel.

11
Development Guide BlackBerry Device Software applications

• To set a field or select a menu item, click the trackwheel.


The BlackBerry Smartphone Simulator assigns BlackBerry device functionality to the following computer keyboard and mouse
procedures:

Task Keyboard steps Mouse steps


Roll the trackwheel. Press the UP ARROW or DOWN ARROW Roll the mouse wheel button.
key.
Click the trackwheel. Press the LEFT ARROW key. Click the mouse wheel button.
Press the Escape key. Press ESC or the RIGHT ARROW key. Click the right mouse button.
Turn on BlackBerry device backlighting. Press PAGE DOWN. Click the Power button on the
BlackBerry Smartphone Simulator
keyboard.
Press the Symbol key. Press DELETE. Click the Symbol key on the BlackBerry
Smartphone Simulator keyboard.
Press the Alt key. Press CTRL. Click the Alt key on the BlackBerry
Smartphone Simulator keyboard.
Press the BlackBerry device keys. Press the keys on your computer Click the keys on the BlackBerry
keyboard. Smartphone Simulator keyboard.
Press the phone/PTT (Push to Talk) Press PAGE UP. —
button.

Note: If you press a key on your computer keyboard that does not have directly correspond to a key on the BlackBerry device
(such as the number or symbol keys), the BlackBerry Smartphone Simulator inserts the character as it appears on the computer
keyboard.

BlackBerry Device Software applications

Use the contact list


1. Open Address Book.
2. On the Address Book menu, click New Address.
3. Type contact information in the appropriate fields.
4. Open the menu.
5. Click Save.

12
Development Guide BlackBerry Device Software applications

Use the calendar


1. Open Calendar.
2. In the Calendar menu, click New.
3. Type appointment information in the appropriate fields the New Appointment screen.
4. Open the menu.
5. Click Save.

Compose an email
1. Open Messages.
2. In the Messages menu, click Compose Email.
3. In the To field, type an email address.
4. Set the Cc, Subject, and Body fields.
5. Open the menu.
6. Click Save Draft
After you finish: The BlackBerry® Email Simulator is required to simulate sending an email message.

Simulate an incoming call


1. On the Simulate menu, click Incoming Voice Call.
2. In the New Incoming Call dialog box, for the originating phone number, type a new phone number or the phone number
of an existing contact.
3. Set one of the following Caller ID options:

Option Description
Allowed The BlackBerry® device can display the phone number of the originating phone.
Private The phone number of the originating phone is blocked and not available for display on
the BlackBerry device.
Unknown The BlackBerry device cannot determine the phone number of the originating phone.
4. To place the phone call to the BlackBerry Smartphone Simulator, click Create Call.
5. Click Answer or Ignore.
6. End the call by performing one of the following actions:

13
Development Guide BlackBerry Device Software applications

Task Steps
Simulate the termination of the call by the originating Click Disconnect.
phone.
Simulate a network failure. Set a reason for failure. Click Fail.

Simulate an outgoing call


1. Open Call Log.
2. In the Call Log menu, click Call From Address Book.
3. In the Call field, type a new phone number or set a contact.
4. Press the Enter key.
5. Open the menu.
6. Click Continue.
7. In the Call to dialog box, perform one of the following actions:
• Click Answer.
• To simulate a failed connection, set a reason for failure. Click Fail.

Using voice activated dialing

Use voice activated dialing to make a call


1. Click the VoiceActivatedDialing icon.
2. Say “Call” and a contact name or number.
3. When the BlackBerry® Smartphone Simulator prompts you to verify the phone number, perform one of the following actions:
• Set the correct phone number from the list and click the trackball.
• Say “Yes” when the BlackBerry Smartphone Simulator reads the correct phone number. Say “No” when the BlackBerry
Smartphone Simulator reads an incorrect phone number. Say “Repeat” to hear the phone number again. Say
“Cancel” if the correct phone number does not appear in the list.

Use voice activated dialing to turn voice prompts on or off


1. Click the VoiceActivatedDialing icon.
2. If prompts are turned on, say “Turn prompts off”.
3. If prompts are turned off, say “Turn prompts on”.

14
Development Guide BlackBerry Device Software applications

Use voice activated dialing to check the device status


When you say “Check Status” the BlackBerry® Smartphone Simulator displays the status of battery, coverage, and signal strength.
1. Click the VoiceActivatedDialing icon.
2. Say “Check” and say one of the following:
• “Battery”
• “Coverage”
• “My Phone Number”
• "Signal strength”
• “Status”

Use the touch screen


BlackBerry® Storm™ 9500 Series smartphones support a number of touch actions, including screen touches, clicks, and
simultaneous touches.

Screen touch Description


Click A screen click is performed by gently pressing the screen until you feel a tactile response.
Touch A screen touch is performed by touching the screen without pressing down on it.
Multiple touch A multitouch action is performed by touching two areas on the screen at the same time.
Each individual touch might also involve sliding your finger across the screen.
Slide A slide is performed by sliding your finger across the screen during a touch action. You
can perform a slide action along with touch or multitouch actions.

Use text messaging


You can use the BlackBerry® Smartphone Simulator to simulate sending an SMS text message to a server side application. Verify
that you have installed the BlackBerry® Java® Development Environment.
1. Click the Call Log icon.
2. Type the destination phone number for the SMS text message.
3. Open the menu.
4. Click SMS <number>.
5. Type your message.
6. Open the menu.
7. Click Send.

15
Development Guide BlackBerry Device Software applications

Using the camera


Make sure your webcam is connected and functioning properly. If the BlackBerry® Smartphone Simulator does not detect a
connected webcam, a prompt appears and you can select a picture file from your hard drive.

Take a picture
1. Click the Camera icon.
2. If prompted, to save pictures to the media card on the BlackBerry® Smartphone Simulator, click Yes. To save pictures to
the BlackBerry Smartphone Simulator device memory, click No.
3. To take a picture, click the trackball.
4. To take another picture, click Take Another Picture.

View a picture
When an application switches to camera viewfinder mode, the viewfinder displays the picture that you select using the Camera
Image menu item. The viewfinder displays the file selector if no picture has been selected before. For best results, select an image
of equal or greater resolution than the camera’s maximum resolution of 1280 by 1024. If you select a picture with a higher
resolution or different aspect ratio than the camera, the Camera application displays only the center of the picture.
1. On the Simulation menu, click Camera Image.
2. Select a .jpg file to view.
After you finish: The last picture that you select becomes the default picture that is displayed the next time you start the
BlackBerry Smartphone Simulator.

Set a picture as the caller ID


1. Click Set As.
2. Click Set As Caller ID.
3. In the Username field, type the user name.
4. In the Domain field, type the domain.
5. In the Password field, type the password.
6. Click OK.

Set a picture as your Home screen background


1. Click Set As.
2. Click Set As Home Screen Image.

16
Development Guide BlackBerry Device Software applications

Rename a picture
1. Click Rename Picture.
2. In the Name field, type a new name.
3. Click OK.

Delete a picture
1. Click Delete Picture.
2. Click Delete to confirm.

Send a picture in an email message


1. Click Send Picture.
2. Click Send As Email.
3. Compose the email message.

Recording video
Before you being, ensure that your webcam is connected and functioning properly. If the BlackBerry® Smartphone Simulator
does not detect a connected webcam, a prompt appears and you can select a jpeg file from your hard drive. You can then click
on the LCD an drag the image around to record the movements as a video.

Record a video
1. Click the Video Camera icon.
2. If prompted, to save videos to the media card on the BlackBerry® Smartphone Simulator, click Yes. To save pictures to the
BlackBerry Smartphone Simulator device memory, click No.
3. To start recording a video, click the trackball.
4. To stop recording, click the trackball.

View a video
1. Click the Video Camera icon.
2. Click the Menu key.
3. Click View Videos.

17
Development Guide BlackBerry Device Software applications

Set video recording options


1. Click the Video Camera icon.
2. Click the Menu key.
3. Click Options.
4. Perform any of the following actions:

Task Steps
Set the video light. Specify the Video Light option.
Set the color effect Specify the Color Effect option.
Set the video resolution. Specify the Video Format action.

Simulate a GPS receiver


A GPS receiver is a device that receives GPS information and transmits it to the BlackBerry® device through a Bluetooth®
connection. Devices must be running applications with JSR179 in order for this functionality to work properly.
To simulate a BlackBerry device that is close enough to a Bluetooth GPS receiver to receive data from the receiver, perform the
following actions:

1. On the Simulate menu, click GPS Location.


2. Set Bluetooth GPS Receiver In Range.

Simulating GPS location information


You can simulate movement between fixed GPS locations, create and save several locations along a route. Once you save the
route, run the simulation.
A location represents one end point of a path. A route can contain one or more paths. The BlackBerry® Smartphone Simulator
emulates movement between locations on a route across one or more paths. You can create and save multiple locations that you
can simulate.

Add a GPS location


1. In the Location section, click Add.
2. In the Name field, type a name.
3. In the Latitude and Longitude fields, type a latitude and longitude.
4. In the Altitude field, type an altitude.

18
Development Guide BlackBerry Device Software applications

5. The BlackBerry® Smartphone Simulator specifies the altitude in metres above (or below) the WGS84 ellipsoid. Visit http://
w3sli.wcape.gov.za/Surveys/Mapping/wgs84.htm on page for more information.
6. In the Satellites field, type the number of satellites that are visible from that location.
7. Click Save.

Change a GPS location


The valid range for latitude is -90 to 90. The valid range for longitude is -180 to 180.
1. In the Location drop-down list, select a location.
2. Click Edit and change the values in the appropriate fields.
Renaming a location will cause routes that contain that location to fail.
3. Click Save.

Delete a GPS location


1. In the Location drop-down list, click a location to delete.
2. Click Delete.

Managing GPS routes


To simulate movement between different GPS locations, set up a route with one or more paths. Each path represents a straight
line between two adjacent locations. Each path contains information about the rate of speed used to travel between the path
start and end locations.
You can use the following rates of speed: metres per second (m/s), kilometres per hour (km/h), metres per hour (m/h), and feet
per second (f/s). The speed limit in terms of metres per second is 655 m/s, with respective limits set for other rates.

Create a GPS route using existing locations


1. On the Simulate menu, click GPS Location.
2. In the Route section, click Add.
3. Click existing locations.
4. Type a name for the new route
5. Select the starting location of the route.
6. Type a speed value and set the rate of speed for the path.
7. Click Insert to insert this location into the route.
8. To add additional locations to the route, repeat steps 3 through 5.
9. Save the route.

19
Development Guide BlackBerry Device Software applications

Create a GPS route using a data file


1. On the Simulate menu, click GPS Location.
2. In the Route section, click Add.
3. Click data from a file.
4. From the Import Route dialog-box, select a data file.
5. Type a name for the data file.
6. Save the route.

Create a GPS route using random data


1. On the Simulate menu, click GPS Location.
2. In the Route section, click Add.
3. Select Create route using random route generator.
4. Click OK.
5. In the new dialog, specify the route name, the number of legs, the duration of the route (in seconds), as well as a start and
end location. If you generated the route successfully, the New Route dialog displays the route information that you typed
in step 3.

Change a GPS route


1. On the Simulate menu, click GPS Location.
2. Set a route to change.
3. Perform one or more of the following procedures:

Task Steps
Change the route name. In the Name field, type a new name for the route.
Add a location to the route. a. Click Insert.
b. In the Start Location drop-down list, click a location.
c. Type a speed value and set the rate of speed for the path.
Change a location. a. In the text box, under the Name field, set the location you want to
change.
b. In the Start Location drop-down list, click the location you want to
change to.

20
Development Guide Changing BlackBerry device operating conditions

Task Steps
c. Type a speed value and set the rate of speed for the path.
Remove a location. a. From the text box, under the Name field, set a location.
b. Click Delete.
4. In the Name field, type a new name for the route.
5. Click Save.

Delete a GPS route


1. On the Simulate menu, click GPS Location.
2. In the Route drop-down list, click a route to delete.
3. Click Delete.

Simulate a GPS route


Route simulation uses the Haversine formula to calculate the changing GPS coordinates and updates the location, the direction,
and the coordinates every second.
1. On the Simulate menu, click GPS Location.
2. Perform one of the following actions:

Task Steps
Play a route. In the Route section, click the Play (right arrow) icon.
Stop a route. In the Route section, click the Stop (black square) icon.
3. To restart the route, stop the simulation. Press the Play Route button.

Changing BlackBerry device operating conditions

Use a single button headset


Perform one of the following actions:

Task Steps
Connect a single button a. On the Simulate menu, click Headset Connected.
headset.
b. In the Headset dialog box, select the One button headset inserted option.

21
Development Guide Changing BlackBerry device operating conditions

Task Steps
Click the button on a single In the Headset dialog box, click Click.
button headset.

Use a multiple button headset


Perform one of the following actions:

Task Steps
Connect a multibutton a. On the Simulate menu, click Headset Connected.
headset.
b. In the Headset dialog box, select the Multibutton headset inserted option.
Click a button on a Under the Multibutton headset inserted option, click one of buttons.
multibutton headset.

Disconnect a headset
1. On the Simulate menu, click Headset Connected.
2. In the Headset dialog box, select the No headset option.

Change holster conditions


When the BlackBerry® device is in the holster, the screen display turns off. By default, the BlackBerry device uses different
notifications when in the holster.

On the Simulate menu, click In Holster.

Use a flip device


When the BlackBerry® 8200 Series smartphone is flipped, the screen display turns off. The BlackBerry device uses the flip screen
to display notifications.
On the Simulate menu, click Flipped.

Simulate battery conditions


1. On the Simulate menu, click Battery Properties.
2. Set one of the following options:

22
Development Guide Changing BlackBerry device operating conditions

Option Description
Full The battery level is sufficient for BlackBerry® device and network use.
Low The BlackBerry device alerts the user, but remains turned on and can still use the network.
Very Low The BlackBerry device cannot access the network, but the device remains turned on.

Camera flash is disabled.


Dead The BlackBerry device turns off immediately.

If you select this option, the BlackBerry Smartphone Simulator shuts down.
Other This option enables you to specify the battery level as a percentage.

Simulate the absence of a SIM card


The BlackBerry® Smartphone Simulator for BlackBerry devices with SIM cards allow you to simulate the absence of a SIM card.
By default, the BlackBerry Smartphone Simulator simulates the SIM card being present.
At the command prompt, type the following command when you start the device:
fledge /handheld=<model_number> /no-sim-present

Simulating network conditions


The BlackBerry® Smartphone Simulator can simulate various states of network coverage, from a strong signal to a very weak
signal. The BlackBerry Smartphone Simulator can also simulate a loss of network coverage.

Add a network
1. On the Simulate menu, click Network Properties.
2. Click Add.
3. Type the network properties in the dialog.
4. Click OK.

Set the network signal strength


1. On the Simulate menu, click Network Properties.
2. Select the network you want to simulate from the Networks list.
3. If you want to edit the network properties, click Edit and type new values. Click OK.
4. Select or clear the In coverage check box.
5. Move the Signal strength (RSSI) slide bar to set a value. The signal strength can be between -120 dBm and -40dBm.

23
Development Guide Changing BlackBerry device operating conditions

Simulate supplementary services


A number of supplementary services, such as call forwarding or call waiting, might be available on a BlackBerry® device. You can
simulate the availability of these services. The BlackBerry Smartphone Simulator is set up with all supplementary services by
default.
1. On the Simulate menu, click Provision Supplementary Services.
2. In the Supplementary Services Provisioned dialog box, enable or disable services.

Reset the flash memory


1. Close the BlackBerry® Smartphone Simulator.
2. Restart the BlackBerry Smartphone Simulator using the /clear-flash command prompt option. For example, type
the following:
fledge /handheld=7730 /serial-port=2 /comm=serial /clear-flash
After you finish: See BlackBerry Integrated Development Environment Online Help for more information on how to set this
option using the BlackBerry Integrated Development Environment.

Simulating flash memory


For each flash session, the BlackBerry® Smartphone Simulator creates several files named <session_name>*.dmp.
Each .dmp file corresponds to a different region of flash memory. By default, the session name represents the model number of
the BlackBerry device that you are simulating. For example, the flash session files for a BlackBerry 7100 Series device simulator
have names such as 7100-fs.dmp, 7100-nv.dmp, and 7100-as.dmp.
When the BlackBerry Smartphone Simulator starts, it loads the flash memory for the device profile; if no flash memory files exist,
the BlackBerry Smartphone Simulator creates new files. When the BlackBerry Smartphone Simulator exits, it saves flash memory
contents to the .dmp files.
The BlackBerry Smartphone Simulator saves changes to flash memory as you make them. To keep changes from overwriting the
original file system, use the /load-filesystem=<session-name>-fs.dmp option. The file system will be saved
to <session-name>-fs.dmp. To specify a unique session name, use the /session command prompt option.
When you reset the flash memory, the BlackBerry Smartphone Simulator removes application data and clears the .dmp files for
the session.

24
Development Guide Changing BlackBerry device operating conditions

Simulating a media card


The BlackBerry® Smartphone Simulator loads and saves the media card image to <session_name>*.sdcard in the
working directory, unless you have set the /sdcard= <path> option. When the BlackBerry Smartphone Simulator starts,
it loads the media card image for the BlackBerry device profile. If no image exists or you have specified /clear-sdcard,
the BlackBerry Smartphone Simulator creates a new media card image when the BlackBerry Smartphone Simulator starts. The
size of the media card image is 32MB, unless you specify otherwise using /sdcard-size=<size> .
You must clear the existing card image using /clear-sdcard to create a new card with the specified size. If a media card image
exists, its size will be retained even if you specify a different size using the /sdcard-size command.
The BlackBerry Smartphone Simulator inserts the media card when the BlackBerry Smartphone Simulator unless you
specify /no-sdcard-inserted.

Change the media card


1. On the Simulate menu, click Change SD Card.
2. Click Open Battery Door.
3. Perform one of the following actions:

Task Steps
Specify a new media card. In the Current SD Card list, specify a new microSD card from the list. To
specify no card, select None.
Add a media card to the Current SD a. Click Add From File.
Card list from a file.
b. Navigate to the location of the media card image file.
c. Click the media card image file.
d. Click Open.
Create a new media card. a. In the Size (MB) field, specify the size (in MB) of the new media card.
b. Click Create.
c. Navigate to the location where you want to save the media card image.
d. Click Save.
Delete a media card a. In the Current SD Card list, click the media card.
b. Click Delete.
4. Click Close Battery Door.

25
Development Guide Changing BlackBerry device operating conditions

5. Click Close.

Simulating a computer connection


Use the BlackBerry® Smartphone Simulator to simulate a serial or USB connection between the BlackBerry device and the
BlackBerry® Desktop Software. Typically, you simulate a serial port connection for BlackBerry devices that use a cradle, and a
USB connection for BlackBerry devices that do not use a cradle.
After you set this option, you can perform any of the BlackBerry® Desktop Manager operations, such as loading applications onto
the BlackBerry device that you simulate.

Simulate a USB connection to the computer


Simulating a USB cable connection enables you to connect the BlackBerry® Smartphone Simulator to the BlackBerry® Desktop
Manager. This option is only available for BlackBerry device models that do not use a cradle. By default, the USB cable is not
connected.
1. In the BlackBerry Desktop Manager window, on the Options menu, click Connection options.
2. In the Connection Type drop-down list, click USB.
3. Click Simulation.
4. To connect or disconnect the USB cable, set the USB cable connected option.

Simulating BlackBerry Enterprise Server APIs and IT policies


To test applications that use BlackBerry® Enterprise Server Extension API, applied IT policies, email and browser messaging,
HTTP/TCP connections, or push functionality, use the BlackBerry Smartphone Simulator to connect to an account on a BlackBerry
Enterprise Server.
The BlackBerry Smartphone Simulator requires the BlackBerry Enterprise Server , BlackBerry® Desktop Manager and BlackBerry®
Device Manager must be version 4.0 or later.

Using the BlackBerry Smartphone Simulator in secure mode


By default, the BlackBerry® Smartphone Simulator does not check for required code signatures and it does not prompt you before
connecting to the network. Before you deploy your application, test it in secure mode using the BlackBerry Smartphone Simulator.
When you enable BlackBerry Smartphone Simulator security, you cannot use the .cod files that come with the BlackBerry
Smartphone Simulator. You must use the .cod files that are installed on the actual BlackBerry device. To obtain the appropriate .cod
files, copy BlackBerry device .cod files from your computer to the BlackBerry Smartphone Simulator installation folder.
By default, the installation folder exists in the following location: C:\Program Files\Common Files\Research In Motion\Shared
\Loader Files\Handheld\Java.

26
Development Guide Changing BlackBerry device operating conditions

Enable secure mode


Set the /secure option when you start the BlackBerry® Smartphone Simulator. For example, type the following
command:
fledge /handheld=7730 /secure

View the event log


The event log window displays information about events that occur between a simulated BlackBerry® device and its environment.
The BlackBerry Smartphone Simulator logs event messages for events including when you simulate playing audio files, placing
a phone call, and blinking the LED screen.
From the Tools menu, click Show Event Log.

27
Development Guide Testing applications using the BlackBerry Smartphone Simulator

Testing applications using the BlackBerry Smartphone 3


Simulator

Testing GPS applications


You may test GPS applications using the BlackBerry® Smartphone Simulator. A GPS application on the BlackBerry Smartphone
Simulator can access GPS data such as the direction, the speed, and the number of visible satellites (satellites provide GPS
information). The GPS application the BlackBerry Smartphone Simulator and should function the same as when the GPS
application runs on a BlackBerry device.
The currently simulated location determines the number of satellites that are visible. When you create a new location, the value
you specify in the Visible satellites field becomes the default value for that field.

Test MIDlets
If the MIDlet is contained in .jad and .jar files, you need to convert these files to a .cod file before loading the .cod file to the
BlackBerry® Smartphone Simulator. You can use the BlackBerry® MDS Simulator to convert the .jad and .jar files to a .cod file.
1. Place the .jad and .jar files on a web server.
2. Start the BlackBerry MDS Simulator.
3. Start the BlackBerry Smartphone Simulator.
4. On the BlackBerry Smartphone Simulator screen, click the Browser icon.
5. Use the browser to navigate to the location of the application .jad file.
6. Download the .jad file to the BlackBerry Smartphone Simulator.
After you finish:
The BlackBerry Smartphone Simulator will automatically load the .cod file on start up.
See the BlackBerry Java Development Environment Development Guide for more information about converting .jad and .jar files.

Testing applications that require an HTTP connection


The BlackBerry® MDS Simulator is designed to simulate the BlackBerry MDS Connection Service component of the BlackBerry®
Enterprise Server. Using the BlackBerry Smartphone Simulator with the BlackBerry MDS Simulator enables you to test network,
push, and browser applications that are designed for use with a BlackBerry Enterprise Server. If you are testing applications that
require an HTTP connection, you will require the BlackBerry Smartphone Simulator and the BlackBerry MDS Simulator. The
BlackBerry MDS Simulator is available for download from the BlackBerry Developer Zone web site at http://www.blackberry.com/
developers on page .

28
Development Guide Testing applications that require an HTTP connection

Start the BlackBerry MDS Simulator and verify that it is running


1. On the taskbar, click Start --> Programs --> Research In Motion --> BlackBerry Email and MDS Services Simulators
--> MDS.
2. Start the BlackBerry® Smartphone Simulator.
3. In the BlackBerry Smartphone Simulator, open the BlackBerry Browser.
4. Open the menu.
5. Click Go To.
6. Type http://www.blackberry.com/go/mobile/.
7. Click OK.
After you finish:
If the BlackBerry home page appears, the BlackBerry® MDS Simulator is working.
If the browser cannot connect to the BlackBerry MDS Simulator, verify that you started the BlackBerry MDS Simulator.
See Mobile Data Service Simulator does not launch for possible causes of the BlackBerry MDS Simulator not starting correctly
and their resolutions.

Connecting the BlackBerry Smartphone Simulator to BlackBerry Enterprise Server or a


BlackBerry MDS Simulator on the same computer
Due to a security enhancement in the BlackBerry® MDS Simulator, you must use the fully qualified computer name or IP address
to establish a connection between a BlackBerry Smartphone Simulator and a BlackBerry® Enterprise Server or a BlackBerry MDS
Simulator that is installed on the same computer as the BlackBerry Smartphone Simulator.

Configuring the BlackBerry MDS Simulator simulator


The default values for the BlackBerry® MDS Simulator parameters are appropriate in most cases; however, you can change
parameters to set the following features:
• logging
• HTTP support
• HTTPS support
• push support
• email-to-PIN mappings.
In a production environment, the BlackBerry® Enterprise Server system administrator sets the BlackBerry MDS Connection Service
parameters using the BlackBerry device management software. Contact your system administrator for more information.

29
Development Guide Testing applications that require an HTTP connection

Configure BlackBerry MDS Simulator properties


1. In a text editor, open the rimpublic.property file from the Program Files\Research In Motion\BlackBerry Email and MDS
Services Simulators 4.1.2\MDS\config\ folder.
2. Configure the file settings as necessary.
3. Restart the BlackBerry® MDS Simulator.

BlackBerry MDS Simulator logging properties

Property Description Default


Logging.file.log.level Specify the type of information to record, 4
if you enable logging:

• 1 — logs information about events


only, such as connection service
start or stop
• 2 — logs events and errors
• 3 — logs events, errors, and
warnings
• 4 — logs events, errors, warnings
and debug messages
Logging.console.log.level Specify the type of information that 4
appears in the console, if you enable
logging. See the description for the
Logging.level property.
application.handler.http.logging
Set to TRUE or FALSE to enable or FALSE
disable HTTP standard logging (HTTP
headers only).

30
Development Guide Testing applications that require an HTTP connection

Property Description Default


application.handler.http. logging.verbose
Set to TRUE or FALSE to enable or FALSE
disable HTTP debug logging (HTTP data
as well as headers). Set this parameter
to TRUE only when necessary to debug
a specific problem.

BlackBerry MDS Simulator HTTP properties

Property Description Default


Logging.file.log.levelapplication.handler.http.CookieSupport
To enable the connection service to store TRUE
cookies on behalf of the BlackBerry®
device, set this property to TRUE. To
store cookies on the BlackBerry device,
set this property to FALSE.
application.handler.http.AuthenticationSupport
Set to TRUE or FALSE to enable or TRUE
disable storage of user authentication
information.
application.handler.http.AuthenticationTimeout
If HTTP authentication is set to TRUE, 3600000
specify the length of time (in
milliseconds) before the authentication
information becomes invalid. This timer
resets whenever the user requests
authentication information for a
particular domain.
application.handler.http.device.connection.timeout
Specify the length of time (in 140000
milliseconds) before a BlackBerry device
connection attempt expires.
application.handler.http.server.connection.timeout
Specify the length of time (in 150000
milliseconds) before a server connection
attempt expires.
http.proxyHost This is the HTTP proxy host name. n/a

31
Development Guide Testing applications that require an HTTP connection

Property Description Default


http.proxyPort This is the HTTP proxy port number. This n/a
is also used by Sun implementations of
HTTP URL connections.

BlackBerry MDS Simulator HTTPS properties

Property Description Default


application.handler.https.allowUntrustedServer
To enable the connection service to FALSE
connect to untrusted servers, set this
property to TRUE. To restrict access to
trusted servers only, set this property to
FALSE. A server is trusted if its
certificate is installed on the BlackBerry
MDS Server host machine.

Parameter Description Default


application.handler.ldap.DEFAULT_SERVER
Specifies the default LDAP directory localhost
server to which to send LDAP queries
application.handler.ldap.DEFAULT_PORT
Specifies the default port to which 389
BlackBerry MDS Services should send
LDAP queries
application.handler.ldap.DEFAULT_QUERY
Specifies a default LDAP query —
application.handler.ldap.DEFAULT_LIMIT
Specifies a default limit for the number 20
of concurrent LDAP queries that
BlackBerry MDS Services supports
application.handler.ldap.COMPRESSION
Specifies whether or not BlackBerry TRUE
MDS Services supports compression of
LDAP queries
application.handler.ldap.logging
Specifies whether or not BlackBerry FALSE
MDS Services logs all LDAP queries
UDP.receive.port Specifies the port on which to listen to 19781
receive UDP packets

32
Development Guide Testing applications that require an HTTP connection

Parameter Description Default


UDP.send.default.port Specifies the default port on which to 19780
send UDP packets
UDP.send.default.host This parameter specifies the default host localhost
to which to send UDP packets.

This must be set to localhost.

Push support
Do not change push application connection service properties.

Property Description Default


WebServer.listen.host This property defines the computer on localhost
which the connection service listens for
HTTP POST requests from push
applications.
WebServer.listen.port This property defines the port number on 8080
which the connection service listens for
HTTP POST requests from push
applications.

Testing push applications

Configure the BlackBerry MDS Simulator to allow reliable push connections


The BlackBerry® MDS Simulator supports pushing to multiple recipients using multiple email addresses or PIN numbers. To test
reliable push applications, add information to the rimpublic.properties file.
1. Open the rimpublic.property file.
2. Add the following line to the file:
push.application.reliable.ports=<####>,where <####> represents the port on
which the BlackBerry device application listens for a push request.

33
Development Guide Testing messaging applications

Map the internet messaging address to the BlackBerry Smartphone Simulator PIN
In a production environment, the BlackBerry® Enterprise Server automatically maps user internet messaging addresses to the
personal identification number (PIN) of their BlackBerry devices. Using the BlackBerry Smartphone Simulator, you can simulate
the mapping between internet messaging addresses and PINs.
You only need to set internet messaging address to PIN mappings if you are testing a push application. See the BlackBerry
Application Developer Guide Volume 1: Fundamentals for more information.

1. Open the rimpublic.property file.


2. In the [Simulator] section, add or change entries.
Entries have the following format:
Simulator.<PIN>=<host>:<port>, <email_address>
For example, the following entry assigns PIN 2100000a to email address user2100000a@pushme.com:
Simulator.2100000a=localhost:81, user2100000a@pushme.com
3. Change the email address so that when a push application sends data to the email address, pushed data is sent to the
address of the specified BlackBerry Smartphone Simulator.
After you finish: The default PIN for the BlackBerry Smartphone Simulator is 2100000a. You can change this setting using the /
pin command prompt option.

Change the BlackBerry Smartphone Simulator PIN


1. In the BlackBerry® Integrated Development Environment, on the Edit menu, click Preferences.
2. Click the Simulator tab.
3. Click the General tab.
4. In the PIN field, type the new PIN.
After you finish: The port must match the value set in the IPPP.push.listen.tcp.port parameter. The default is
81.

Testing messaging applications


The BlackBerry® Email Simulator is designed to send and receive messages between the BlackBerry Smartphone Simulator and
either a messaging application, such as Microsoft® Outlook®, or POP3 and SMTP servers. You do not require a BlackBerry®
Enterprise Server. The BlackBerry Email Simulator is available for download from the BlackBerry Developer Zone web site at
http://www.blackberry.com/developers.

34
Development Guide Testing messaging applications

Configure a POP3 and SMTP server connection


1. On the taskbar, click Start > Programs > Research In Motion > BlackBerry Email and MDS Services Simulators 4.1.2
> ESS.
2. In the BlackBerry® Email Simulator window, ensure the Connected mode option radio button is selected.
3. In the Outgoing field, type the host name of the SMTP server that your email account uses.
4. In the Incoming field, type the host name of the POP3 server that your email account uses.
5. In the User name field, type the user name with which to connect to your email account.
6. In the Password field, type the password with which to connect to your email account.
7. In the Poll inbox field, specify how often, in seconds, the email server simulator checks your inbox for new messages.
8. In the Name field, type the name to display in outgoing messages.
9. In the Email field, type the email address to display in outgoing messages.
10. In the PIN field, type the personal information number (PIN) that the BlackBerry Smartphone Simulator uses. By default,
the PIN is 0x2100000A.

Send a message
1. Start the BlackBerry® Email Simulator.
2. In the BlackBerry Email Simulator window, ensure the Standalone mode option radio button is selected.
3. Click Launch.
4. Start the BlackBerry Smartphone Simulator.
5. Navigate to the Messages icon.
6. Open the Messages application.
7. Open the menu.
8. Click Compose Email.
9. In the To field, type an email address.
10. Fill in the Cc, Subject, and Body fields.
11. Open the menu.
12. Click Send.

Receive a message
1. Start the BlackBerry® Email Simulator.
2. In the BlackBerry Email Simulator window, ensure the Standalone mode option radio button is selected.
3. Click Launch.

35
Development Guide Testing BlackBerry Enterprise Server APIs and IT policies

4. Start the BlackBerry Email Simulator.


5. When the BlackBerry Email Simulator receives an email, open the Messages application.

Testing BlackBerry Enterprise Server APIs and IT policies


The BlackBerry® Smartphone Simulator can connect to an account on the BlackBerry® Enterprise Server . If you have access to
a BlackBerry Enterprise Server, you can simulate all the functionality that is available when connecting a BlackBerry device to a
BlackBerry Enterprise Server . Use this option to simulate use of the BlackBerry Enterprise Server Extension Application
Programming Interface (API), and applied IT policies. This option requires knowledge of BlackBerry Enterprise Server
administration, and introduces network dependency to testing. You will not require a BlackBerry® MDS Simulator or an
BlackBerry® Email Simulator.

Test a BlackBerry Smartphone Simulator with a BlackBerry Enterprise Server


1. From the BlackBerry® Java® Development Environment (BlackBerry IDE) or from the start menu, run the BlackBerry
Smartphone Simulator.
2. On the Home screen, click the Turn Wireless Off icon.
3. From the taskbar, click Start --> Programs --> BlackBerry --> Desktop Manager.
4. From the BlackBerry Smartphone Simulator taskbar, perform one of the following actions:
• Click Simulate --> USB Connected.
• Click Simulate --> Serial Connected.
5. Click Yes.
6. Follow the instructions to generate a new encryption key.
7. In the Initial Plug-in: Verifying Applications dialog box, click Cancel.
After you finish: When the initial synchronization with the computer is complete, the enterprise activation starts. You will then
be able to simulate use of the BlackBerry® Enterprise Server Extension API, applied IT policies, email traffic, browser traffic, HTTP/
TCP connections, BlackBerry Application Mobility Suite, and push functionality.

36
Development Guide Using the BlackBerry Smartphone Simulator programmatically

Using the BlackBerry Smartphone Simulator 4


programmatically
The BlackBerry® Smartphone Simulator controller is a command prompt tool that is used to programmatically control the
BlackBerry Smartphone Simulator. Use the BlackBerry Smartphone Simulator controller commands to instruct the BlackBerry
Smartphone Simulator to perform the following actions:

Action Description
Issue device commands. Issue commands manipulating the BlackBerry Smartphone Simulator (for example, close the
BlackBerry Smartphone Simulator, hide the BlackBerry Smartphone Simulator window).
Generate external events. Simulate events generated externally from the BlackBerry device (for example, an incoming
phone call, moving between GPS locations).

Start the BlackBerry Smartphone Simulator controller


BlackBerry® Smartphone Simulator controller commands have the following format:
fledgecontroller /session={name} [/execute={command}] [/timeout={time-in-
seconds}] [/get-sessions]

Invocation Method Example Description


/execute fledgecontroller The BlackBerry Smartphone Simulator
controller issues the BatteryLevel(5) command
/session=7290
to the BlackBerry Smartphone Simulator for
/execute=BatteryLevel(5) the BlackBerry® 7290 of wireless devices and
exits.
Standard input fledgecontroller If you do not use the /execute command,
/session=7290 the BlackBerry Smartphone Simulator
controller sends commands from standard
...

...

37
Development Guide Send commands to the BlackBerry Smartphone Simulator

Invocation Method Example Description


BatteryLevel(5) input to the BlackBerry Smartphone Simulator.
You must manually exit the BlackBerry
Smartphone Simulator controller session.

Send commands to the BlackBerry Smartphone Simulator


The BlackBerry® Smartphone Simulator interface reflects the commands you type. The following instructions assume that you
have the BlackBerry® Java® Development Environment (BlackBerry JDE) installed on your computer.
1. At the command prompt, type an instruction for moving to the bin directory of your BlackBerry JDE installation:
cd \Program Files\Research In Motion\BlackBerry JDE 4.2.0\bin
2. Start the BlackBerry Smartphone Simulator. For example, at the command prompt, type the following:
fledge /handheld=7290
3. Connect the BlackBerry Smartphone Simulator controller to a running BlackBerry Smartphone Simulator:
fledgecontroller /session=7290
4. Type a BlackBerry Smartphone Simulator controller command (one per line). For example, at the command prompt type the
following:
BatteryLevel(5)

Exit the BlackBerry Smartphone Simulator controller session


Perform one of the following actions:

Action Description
End the session connection. Perform one of the following actions:

• At the command prompt, type quit.


• Press CTRL+Z.

38
Development Guide Using test scripts

Action Description
End the session and close the At the command prompt, type exit.
BlackBerry® Smartphone
Simulator.

Using test scripts


The BlackBerry® Smartphone Simulator controller command prompt tool can be utilized within scripts for automated tests. When
events inside the BlackBerry Smartphone Simulator occur, the BlackBerry Smartphone Simulator controller prints out messages.
This is designed to enable you to test events that normally would only be perceived visually or audibly. Tools that automate GUI
tests are not required.

Test BlackBerry Smartphone Simulator events using script


1. Create a command file. For example, in a text file called PhoneTest.txt, type the following instructions:
Pause(45)
RemoteCallCreation("555-1234")
Pause(2)
ThumbwheelPress
ThumbwheelRelease
Pause(10)
KeyPress(ESCAPE)
Pause(2)
KeyRelease(ESCAPE)
Exit
2. Save the command file in the same directory of your BlackBerry® installation:
cd \Program Files\Research In Motion\BlackBerry JDE 4.2.0\bin
3. Create a .bat file with instructions for starting the BlackBerry Smartphone Simulator and creating a session. For example,
in a file called PhoneTest.bat, type the following instruction:
start fledge.exe /c fledge-settings.conf /handheld=7290 /session=test
4. In the .bat file, write instructions for connecting the BlackBerry Smartphone Simulator controller to the session, inputting
data from the command file and directing output to a text file. (In this example, the name of the output file is out.txt). For
example:
FledgeController.exe /session=test < PhoneTest.txt > out.txt

39
Development Guide Use BlackBerry Smartphone Simulator controller commands

Note: .bat instructions in the example assume that you create the .bat file in the same location as the fledge.exe file. If
you save the .bat file to a different location, include path location information for fledge.exe and fledgeController.exe in
the .bat file.
5. Save the .bat file in the bin directory of your BlackBerry installation:
cd \Program Files\Research In Motion\BlackBerry JDE 4.2.0\bin
6. At a command prompt, move to the bin directory of your BlackBerry installation. For example, type:
cd \Program Files\Research In Motion\BlackBerry JDE 4.2.0\bin
7. Start the .bat file. For example type:
PhoneTest.bat
After you finish:
The BlackBerry Smartphone Simulator controller starts and issues commands to the BlackBerry Smartphone Simulator. After all
commands in the command file are issued, the BlackBerry Smartphone Simulator closes and messages are written to the text
file. In the current example, out.txt contains the following messages:
FledgeController.exe /session=test < PhoneTest.txt > out.txt
Audio: alert stopped
Connecting to Fledge session "test"... connected.
Buzzer: alert started
Buzzer: alert stopped
Audio: alert started
Disconnected

Use BlackBerry Smartphone Simulator controller commands


To view a list of commands for controlling the BlackBerry® Smartphone Simulator, perform one of the following actions:

Action Description
View a list of commands from On the Help menu, click Controller Command Help.
the BlackBerry Smartphone
Simulator.
View a list of commands from At the command prompt, type help.
a command prompt.

40
Development Guide Use BlackBerry Smartphone Simulator controller commands

Action Description
For more information on running the BlackBerry Smartphone Simulator controller, type
FledgeController /help.

Behavior and appearance commands


Use application commands to control the behaviour and appearance of the BlackBerry® Smartphone Simulator.

Action Application command Parameter


Display help on BlackBerry Help
Smartphone Simulator
controller commands.
Pause the BlackBerry Pause (int time) time : Type the the number of seconds to
Smartphone Simulator pause the BlackBerry Smartphone Simulator
controller for the given time. controller.
Exit the BlackBerry Exit (bool save-flash) save-flash : The default value of true
Smartphone Simulator. saves your changes to simulated flash memory
before closing the BlackBerry Smartphone
Simulator.
Terminate the BlackBerry Kill
Smartphone Simulator
Type this command to clean up without
process.
saving simulated flash memory. If the clean
up process fails, the process is terminated.
Reset the simulator. Reset
Get the ID of the BlackBerry GetPid
Smartphone Simulator
process.
View or hide the main WindowShow (bool show = true) show : The default value of true displays the
window. main window. To hide the main window, set this
parameter to false.
Move the main BlackBerry WindowRaise
Smartphone Simulator
window to the foreground.

41
Development Guide Use BlackBerry Smartphone Simulator controller commands

Action Application command Parameter


Windows will usually block this command
unless the application with focus calls the
AllowSetForegroundWindow API.
Move the main BlackBerry WindowLower
Smartphone Simulator
window behind all other
windows.
Allow another application to AllowFocusChange
obtain the foreground
window focus from the
BlackBerry Smartphone
Simulator.
Load a Java® application LoadCod (Path filename) filename : Type the full path to the .cod
in .cod format. file of the application.

Location commands
Use environment commands to control the surrounding environment of the BlackBerry® device.

Action Environment command Parameter


Change the GPS location of Location (double latitude, • latitude : Type a latitude value
double longitude, short
the BlackBerry device. altitude = 0) between 89.99 and -90.00 degrees.
• longitude : Type a longitude value
between 179.99 and -180.00 degrees.
• altitude : Type an altitude in metres
above (or below if negative) the WGS84
ellipsoid. By default, this parameter is set
to 0.

Keyboard and event commands


Use input commands to generate keyboard and input BlackBerry® device events.

42
Development Guide Use BlackBerry Smartphone Simulator controller commands

Action Input command Parameter


Press a key. KeyPress (key-types key) key : Type the key that you wish to use for a
press key event.
Release a key. KeyRelease (key-types key) key : Type the key that you wish to use for a
release key event.
Enter a character string into StringInjection (string string : Type the character string to enter
string)
the applications (even if into the application.
characters contained in the
string do not correspond to
keys on the BlackBerry
device).
Press a pre-translated key. PreTranslatedKeyPress key : Type the key that you wish to use for a
(char key)
press pre-translated key event.
Release a pre-translated key. PreTranslatedKeyRelease key : Type the key that you wish to use for a
(char key)
release pre-translated key event.
Press the trackwheel. ThumbwheelPress
Release the trackwheel. ThumbwheelRelease
Roll the trackwheel. ThumbwheelRoll (int movement : Type the number of clicks to
movement)
roll the thumbwheel. Type positive values to
indicate downward rolls and type negative
value to indicate upward rolls.
Press the trackball. TrackballPress
Release the trackball. TrackballRelease
Roll the trackball. TrackballRoll (int x- x-delta : Type the number of clicks to roll
delta, int y-delta)
the trackball in the left or right direction. Type
positive values to indicate right rolls and type
negative values to indicate left rolls.

y-delta : Type the number of clicks to roll


the trackball in the up or down direction. Type
positive values to indicate upward rolls and
type negative values to indicate downward
rolls.

43
Development Guide Use BlackBerry Smartphone Simulator controller commands

Data and phone commands


Use network commands to generate data and phone events.

Action Network command Parameter


Set network coverage level. NetworkCoverage (int RSSI) RSSI : Type the dB level, with -40 being
strong and -256 being out of coverage
Simulate a remote phone that RemoteCallAnswer
answers a call placed from
the BlackBerry® device.
Place a new call from a RemoteCallCreation (string • number : Type the phone number that
number, presentation-
remote phone to the indicator-types you want to call.
BlackBerry device. presentation-indicator = • presentation-indicator :
PI_ALLOWED)
Type a value to control the display of the
caller ID. By default, this parameter is set
to the constant PI_ALLOWED.
Hang up a remote phone. RemoteCallDisconnection number : Type the phone number to
(string number)
disconnect from.
Generate a call failure. RemoteCallFailure (string • number : Type the phone number to
number, reason-types
reason) use for the remote call failure simulation.
• reason : Type a reason for the remote
call failure.
Provision a supplementary SupplementaryServiceProvis • service : Type the supplementary
ioning (service-types
service. service, bool provisioned) service type to simulate.
• provisioned - Set this parameter
to true to make the service appear
provisioned. Set this parameter to false to
make the service appear not provisioned.

BlackBerry device accessory commands


Use peripheral commands to generate BlackBerry® device peripheral events.

44
Development Guide Use BlackBerry Smartphone Simulator controller commands

Action Peripheral command Parameter


Set the charge level of the BatteryLevel (int level) level : Type the charge level of the battery.
battery.
Set battery charging on or off. BatteryCharge (bool charging : Type true to simulate battery
charging)
charging. Set this parameter to false to
simulate the battery not charging.
Connect or disconnect the HeadsetConnection (bool connected : Type true to simulate a
connected)
external headset. connection to the external headset. If you type
false, a connection to the external headset is
not simulated.
Hang up a remote phone. RemoteCallDisconnection number : Type the phone number to
(string number)
disconnect from.
Press or release the button on HeadsetClick (bool pressed - When this parameter is set to true,
pressed)
the external headset. the button appears pressed; when it is set to
false, the button does not appear pressed.
Holster or unholster the Holster (bool holstered) holstered - When this parameter is set to
BlackBerry device. true, the BlackBerry device is in the holster;
when it is set to false, the BlackBerry device is
not in the holster.
Insert or remove the SIM SimInsertion (bool inserted - When this parameter is set to
inserted)
card. true, the SIM card is inserted; when it is set to
false, the SIM card is not inserted.

45
Development Guide Provide feedback

Provide feedback 5
To provide feedback on this deliverable, visit www.blackberry.com/docsfeedback.

46
Development Guide Legal notice

Legal notice 6
©2009 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, SureType®, SurePress™ and
related trademarks, names, and logos are the property of Research In Motion Limited and are registered and/or used in the U.S.
and countries around the world.
Casira End Point is a trademark of Bluetooth Designer. Java is a trademark of Sun Microsystems, Inc. Microsoft, Outlook, and
Windows are trademarks of Microsoft Corporation.All other trademarks are the property of their respective owners.
The BlackBerry smartphone and other devices and/or associated software are protected by copyright, international treaties, and
various patents, including one or more of the following U.S. patents: 6,278,442; 6,271,605; 6,219,694; 6,075,470; 6,073,318;
D445,428; D433,460; D416,256. Other patents are registered or pending in the U.S. and in various countries around the world.
Visit www.rim.com/patents for a list of RIM (as hereinafter defined) patents.
This documentation including all documentation incorporated by reference herein such as documentation provided or made
available at www.blackberry.com/go/docs is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition,
endorsement, guarantee, representation, or warranty of any kind by Research In Motion Limited and its affiliated companies
("RIM") and RIM assumes no responsibility for any typographical, technical, or other inaccuracies, errors, or omissions in this
documentation. In order to protect RIM proprietary and confidential information and/or trade secrets, this documentation may
describe some aspects of RIM technology in generalized terms. RIM reserves the right to periodically change information that
is contained in this documentation; however, RIM makes no commitment to provide any such changes, updates, enhancements,
or other additions to this documentation to you in a timely manner or at all.
This documentation might contain references to third-party sources of information, hardware or software, products or services
including components and content such as content protected by copyright and/or third-party web sites (collectively the "Third
Party Products and Services"). RIM does not control, and is not responsible for, any Third Party Products and Services including,
without limitation the content, accuracy, copyright compliance, compatibility, performance, trustworthiness, legality, decency,
links, or any other aspect of Third Party Products and Services. The inclusion of a reference to Third Party Products and Services
in this documentation does not imply endorsement by RIM of the Third Party Products and Services or the third party in any way.
EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION, ALL CONDITIONS,
ENDORSEMENTS, GUARANTEES, REPRESENTATIONS, OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
WITHOUT LIMITATION, ANY CONDITIONS, ENDORSEMENTS, GUARANTEES, REPRESENTATIONS OR WARRANTIES OF
DURABILITY, FITNESS FOR A PARTICULAR PURPOSE OR USE, MERCHANTABILITY, MERCHANTABLE QUALITY, NON-
INFRINGEMENT, SATISFACTORY QUALITY, OR TITLE, OR ARISING FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING
OR USAGE OF TRADE, OR RELATED TO THE DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-PERFORMANCE
OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN, ARE
HEREBY EXCLUDED. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE. SOME JURISDICTIONS
MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. TO THE EXTENT
PERMITTED BY LAW, ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT
THEY CANNOT BE EXCLUDED AS SET OUT ABOVE, BUT CAN BE LIMITED, ARE HEREBY LIMITED TO NINETY (90) DAYS FROM
THE DATE YOU FIRST ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM.

47
Development Guide Legal notice

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, IN NO EVENT SHALL RIM BE LIABLE
FOR ANY TYPE OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-
PERFORMANCE OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED
HEREIN INCLUDING WITHOUT LIMITATION ANY OF THE FOLLOWING DAMAGES: DIRECT, CONSEQUENTIAL, EXEMPLARY,
INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR AGGRAVATED DAMAGES, DAMAGES FOR LOSS OF PROFITS OR REVENUES,
FAILURE TO REALIZE ANY EXPECTED SAVINGS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, LOSS OF
BUSINESS OPPORTUNITY, OR CORRUPTION OR LOSS OF DATA, FAILURES TO TRANSMIT OR RECEIVE ANY DATA, PROBLEMS
ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES, DOWNTIME COSTS,
LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES, COST OF
SUBSTITUTE GOODS, COSTS OF COVER, FACILITIES OR SERVICES, COST OF CAPITAL, OR OTHER SIMILAR PECUNIARY
LOSSES, WHETHER OR NOT SUCH DAMAGES WERE FORESEEN OR UNFORESEEN, AND EVEN IF RIM HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, RIM SHALL HAVE NO OTHER
OBLIGATION, DUTY, OR LIABILITY WHATSOEVER IN CONTRACT, TORT, OR OTHERWISE TO YOU INCLUDING ANY LIABILITY
FOR NEGLIGENCE OR STRICT LIABILITY.
THE LIMITATIONS, EXCLUSIONS, AND DISCLAIMERS HEREIN SHALL APPLY: (A) IRRESPECTIVE OF THE NATURE OF THE
CAUSE OF ACTION, DEMAND, OR ACTION BY YOU INCLUDING BUT NOT LIMITED TO BREACH OF CONTRACT, NEGLIGENCE,
TORT, STRICT LIABILITY OR ANY OTHER LEGAL THEORY AND SHALL SURVIVE A FUNDAMENTAL BREACH OR BREACHES
OR THE FAILURE OF THE ESSENTIAL PURPOSE OF THIS AGREEMENT OR OF ANY REMEDY CONTAINED HEREIN; AND (B)
TO RIM AND ITS AFFILIATED COMPANIES, THEIR SUCCESSORS, ASSIGNS, AGENTS, SUPPLIERS (INCLUDING AIRTIME
SERVICE PROVIDERS), AUTHORIZED RIM DISTRIBUTORS (ALSO INCLUDING AIRTIME SERVICE PROVIDERS) AND THEIR
RESPECTIVE DIRECTORS, EMPLOYEES, AND INDEPENDENT CONTRACTORS.
IN ADDITION TO THE LIMITATIONS AND EXCLUSIONS SET OUT ABOVE, IN NO EVENT SHALL ANY DIRECTOR, EMPLOYEE,
AGENT, DISTRIBUTOR, SUPPLIER, INDEPENDENT CONTRACTOR OF RIM OR ANY AFFILIATES OF RIM HAVE ANY LIABILITY
ARISING FROM OR RELATED TO THE DOCUMENTATION.
Prior to subscribing for, installing, or using any Third Party Products and Services, it is your responsibility to ensure that your
airtime service provider has agreed to support all of their features. Some airtime service providers might not offer Internet browsing
functionality with a subscription to the BlackBerry® Internet Service. Check with your service provider for availability, roaming
arrangements, service plans and features. Installation or use of Third Party Products and Services with RIM's products and services
may require one or more patent, trademark, copyright, or other licenses in order to avoid infringement or violation of third party
rights. You are solely responsible for determining whether to use Third Party Products and Services and if any third party licenses
are required to do so. If required you are responsible for acquiring them. You should not install or use Third Party Products and
Services until all necessary licenses have been acquired. Any Third Party Products and Services that are provided with RIM's
products and services are provided as a convenience to you and are provided "AS IS" with no express or implied conditions,
endorsements, guarantees, representations, or warranties of any kind by RIM and RIM assumes no liability whatsoever, in relation
thereto. Your use of Third Party Products and Services shall be governed by and subject to you agreeing to the terms of separate
licenses and other agreements applicable thereto with third parties, except to the extent expressly covered by a license or other
agreement with RIM.
Certain features outlined in this documentation require a minimum version of BlackBerry® Enterprise Server, BlackBerry® Desktop
Software, and/or BlackBerry® Device Software.

48
Development Guide Legal notice

The terms of use of any RIM product or service are set out in a separate license or other agreement with RIM applicable thereto.
NOTHING IN THIS DOCUMENTATION IS INTENDED TO SUPERSEDE ANY EXPRESS WRITTEN AGREEMENTS OR WARRANTIES
PROVIDED BY RIM FOR PORTIONS OF ANY RIM PRODUCT OR SERVICE OTHER THAN THIS DOCUMENTATION.

Research In Motion Limited


295 Phillip Street
Waterloo, ON N2L 3W8
Canada

Research In Motion UK Limited


Centrum House
36 Station Road
Egham, Surrey TW20 9LF
United Kingdom

Published in Canada

49

You might also like