Running Mobile Device Simulators with ADF Mobile and JDeveloper

An Oracle JDeveloper How To Document
Written by Joe Huang, Oracle Corporation
Updated February, 2009

The Challenges of Testing Mobile Applications

Applications running on mobile devices are subjected to a number of limitations and characteristics introduced by the device itself.  Beyond screen resolution and form factors, factors such as navigation patterns and hardware keys also impacts the overall usability of an application running on a particular mobile device.  Running mobile device simulators with JDeveloper typically produces the most accurate and faithful test results of how an ADF Mobile application behaves on an actual mobile device.   There are two steps in setting up and running mobile device simulators with JDeveloper:

  • Setup of the Mobile Device Simulator
  • Connect Browser Mobile to Embedded WebLogic Server in the JDeveloper

Please note that these device simulators will only run on Windows Desktop PCs.   For JDeveloper users running on Linux or Apple desktops, you can still host and run the application on your desktops.   However, the simulator themselves must run on Windows Desktop PCs.   Simulators do not have to run on the same machine as the JDeveloper.

Running with BlackBerry Simulator

Download and Installation of BlackBerry Simulator

The first step is to download two packages from your desktop.  Please note that you can only install BlackBerry simulators on a machine running MS Windows.  

  1. BlackBerry Device Simulators: this simulates a BlackBerry device.   Please choose the BlackBerry model most appropriate for your deployment.
  2. BlackBerry Email and MDS Service Simulator Package: this simulates server components necessary to connect the BlackBerry device simulator with the network.  Without this simulator, BlackBerry simulator will be unable to communicate with the JDeveloper.  Please download Email and MDS Service Simulator version 4.1.4 or above.
Caution: Please do not use Email and MDS Service Simulator version 4.1.2.  Using version 4.1.2 in conjunction with BlackBerry 4.2 to 4.5 simulators will result in disabled navigation and errors on ADF Mobile Pages.

The simulator packages are located at  http://na.blackberry.com/eng/developers/resources/simulators.jsp.

You may be directed to a different URL if you reside outside North America.

Each of the packages is downloaded as executable files.  To begin the installation process, simply double click on the downloaded executable files.  Follow the installation directions on screen to install the simulators.  You should see two installed programs at the end of the installation.

Initialize and Connect the Simulator

To initialize the BlackBerry Simulators, you first start the MDS Service simulator, and then Device simulator.  This should be done in sequence, otherwise the Device simulator may not  be able to communicate with MDS Service simulator and the network.

  1. To start MDS Service simulator, click on the windows "start" menu, and then select  "All Programs -> Research In Motion -> BlackBerry Email and MDS Services Simulators <version> -> MDS" item.  This will start a DOS command prompt that runs the MDS Service simulator.   Wait until the message "....pending push messages" is displayed in the DOS window.
  2. Next, start the Device simulator by clicking on the windows "start" menu, and selecting "All Programs -> Research In Motion -> BlackBerry Device Simulators <Version> -> <Version> -> <Device Simulator Name>".  This will start a DOS prompt and the device simulator window.  Please wait until the simulator is completely boot up.
The simulator is ready for use.

Running JDeveloper with the BlackBerry Simulator

Running ADF Mobile application involves running the ADF Mobile application from JDeveloper, start the device simulator browser, and direct the browser to an instance of ADF Mobile application hosted by JDeveloper's embedded WebLogic Server.  

  1. First, start the ADF Mobile application from JDeveloper by right-mouse click and select "Run" from the page you want to start on, or via other favorite toolbar/menu items.  Once the WLS startup is complete, you should see the selected page displayed in the default desktop browser.   This is an indication that the test application is ready to be accessed.  
  2. Please note  that in the Message-Log window of JDeveloper, you should see the URL to the test application.  This is the same URL used by the default desktop browser to communicate with the test application.  Please make a note of this URL.
  3. The hostname portion of this URL is typically 127.0.01 (localhost).   This hostname typically works with desktop browsers, but will not work with mobile browsers in Windows Mobile emulator.   Therefore, you must identify the IP address of the PC running JDeveloper.   On a Windows PC, you would:
    • Start a command (DOS) prompt
    • Type “ipconfig” at the prompt
    • Note the IP address returned on the screen
  4. Next, start the BlackBerry web browser in the simulator by either use the simulated track-ball or arrow key to highlight and select the browser icon on the BlackBerry desktop.  Then click on the track-ball or the keyboard Enter key to start the browser application.  This should bring up the default bookmark page.
  5. Click on the menu button in the simulator to display the menu items, and select "Goto...".
  6. In the URL field, type in the URL from the JDeveloper Message-Log windows (Step 2).  Replace the localhost (127.0.0.1) host name portion of the URL with the IP address you obtained from step 3.
  7. BlackBerry browser should now display the ADF Mobile page you have developed in JDeveloper.

Running with Microsoft Windows Mobile Device Emulator

Download and Installation of the Windows Mobile Device Emulator

First step is to download all necessary files for the emulator.   For Windows Mobile emulators, there are typically two sets of files to download:

  1. If you are running Windows Vista, or have already installed the latest version of ActiveSync, please skip this step.  The first step is to download the latest version of Microsoft ActiveSync at   http://www.microsoft.com/windowsmobile/activesync/activesync45.mspx
  2. Install ActiveSync as per on screen instructions.
  3. Download Windows Mobile Emulator images.  Download the version and localized image of Emulator for the type of Windows Mobile device you are targeting for deployment.   For example, if your target deployment devices have Windows Mobile 6 (USA) version of the Windows Mobile OS, then download “Windows Mobile 6 Professional Images (USA).msi” version.  
  4. After downloading the emulator images, you install the emulator images by simply double-clicking on the downloaded files.  Downloaded files are in .msi format, which would automatically invoke Microsoft installer to initiate the installation process.

Initialize and Connect the Emulator

After the emulators are installed, you will perform the following tasks to start the emulator and connect it to your PC:

  1. First check to see if ActiveSync is already running on the taskbar.   At this point, ActiveSync should be inactive, but still shows up in the taskbar.
  2. Double click on the ActiveSync icon in the taskbar to open the ActiveSync window.
  3. Next, in the ActiveSync application, select the File menu, and click on the Connection Settings menu item.   Check "Allow connection to the following" checkbox and select "DMA".
  4. Next, you start the emulator by clicking on the Windows "Start" menu, and select "All Programs -> Windows Mobile 6 SDK-Standalone Emulator Images -> <Installed Language> -> <emulator image>” to start the emulator.    With the example of Windows Mobile 6 USA version above, select “Start-Programs-Windows Mobile 6 SDK-Standalone Emulator Images-US English-Professional”.  This starts an instance of the device emulator.
  5. Next, you will simulate the device being placed in a cradle, which connects the emulator to your PC.  This will give network access to the emulator.  To do that, you start the Device Emulator Manager by clicking on the Windows "Start" menu, and select "All Programs -> Windows Mobile 6 SDK -> Tools -> Device Emulator Manager”.  This will start the Device Emulator Manager program.   Highlight the instance of the emulator running (there should be just one entry to select, tagged with some along alphanumeric string), and select the Action-Cradle menu item in the Device Emulator Manager window..  
  6. You should see ActiveSync starting up and connecting to the device emulator.  The device emulator should now be connected.

Running JDeveloper with the Windows Mobile Emulator

Running ADF Mobile application involves running the ADF Mobile application from JDeveloper, start the device simulator browser, and direct the browser to an instance of ADF Mobile application hosted by JDeveloper's embedded WebLogic Server.  

  1. First, start the ADF Mobile application from JDeveloper by right-mouse click and select "Run" from the page you want to start on, or via other favorite toolbar/menu items.  Once the WLS startup is complete, you should see the selected page displayed in the default desktop browser.   This is an indication that the test application is ready to be accessed.  
  2. Please note  that in the Message-Log window of JDeveloper, you should see the URL to the test application.  This is the same URL used by the default desktop browser to communicate with the test application.  Please make a note of this URL.
  3. The hostname portion of this URL is typically 127.0.01 (localhost).   This hostname typically works with desktop browsers, but will not work with mobile browsers in Windows Mobile emulator.   Therefore, you must identify the IP address of the PC running JDeveloper.   On a Windows PC, you would:
    • Start a command (DOS) prompt
    • Type “ipconfig” at the prompt
    • Note the IP address returned on the screen
  4. Next, start the Internet Explorer in the device emulator.  The steps differ between touch-screen (Profession and Classic) and non-touch screen (Standard) versions.   Generally, Internet Explorer in the devices is under the "Start" menu.
  5. In the address (URL) field of the Internet Explorer, type in the URL from the JDeveloper Message-Log windows (Step 2).  Replace the localhost (127.0.0.1) host name portion of the URL with the IP address you obtained from step 3.
  6. Windows Mobile Internet Explorer should now display the ADF Mobile page you have developed in JDeveloper.

Please note that these setup steps may change over time.  Therefore, for the portion of the instructions that are device simulator specific, always reference the latest instructions from simulator vendors.