Running Mobile Device Simulators with ADF Mobile and JDeveloper
An Oracle JDeveloper How To Document
Written by Joe Huang, Oracle Corporation
February, 2008 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 OC4J 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 (JDeveloper 11g and above)
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.
- Blackberry Device
Simulators: this simulates a Blackberry device. Please choose the Blackberry model most
appropriate for your deployment.
- 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.
The simulator packages are located at http://na.blackberry.com/eng/developers/downloads/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.
- 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.
- 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 OC4J. - 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 OC4J 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.
- 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.
- 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
- 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.
- Click on the menu button in the simulator to display the menu items, and select "Goto...".
- 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.
- 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:
- 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
- Install ActiveSync as per on screen instructions.
- 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.
- 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:
- 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.
- Double click on the
ActiveSync icon in the taskbar to open the ActiveSync window.
- 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".
- 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.
- 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..
- 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 OC4J. - 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 OC4J 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.
- 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.
- 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
- 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.
- 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.
- 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.
|