Skip Headers
Oracle® Java ME Embedded Getting Started Guide for the Windows Platform
Release 8 EA 2 for NetBeans on Windows
E48511-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

Beta Draft: 2014-02-15

3 Using the Emulators

The Oracle Java ME SDK 8 EA 2 embedded emulation environment provides you with a platform for testing and running Oracle Java ME Embedded Profile (MEEP) IMlet suites without having to install those IMlet suites onto an embedded device.

This is done using two default embedded emulators (EmbeddedDevice1 and EmbeddedDevice2). These emulators do not represent a specific device, but provide a correct implementation of the APIs for this platform.

The Qualcomm_IoE_Device emulator, which is also described in this chapter, provides an emulation of the Qualcomm Orion IoE embedded hardware device. For more information, see the Oracle Java ME Embedded Getting Started Guide for the Reference Platform (Qualcomm Orion IoE).

This chapter describes how to run and use the Oracle Java ME SDK 8 EA 2 embedded emulators.

Launching the Emulator

If the Embedded emulator is not displayed when you finish building the sample project described in Chapter 2, it can be launched from the Windows command line. For more information, see Appendix A, "Using the Command Line Emulator."

The Emulator's Main Screen

The Oracle Java ME SDK 8 EA 2 Embedded emulator provides several ways to interact with an emulated device (for example, EmbeddedDevice1), as shown in Figure 3-1.

Figure 3-1 The Oracle Java ME SDK 8.0 EA Emulator Toolbar and Menu Items

Description of Figure 3-1 follows
Description of "Figure 3-1 The Oracle Java ME SDK 8.0 EA Emulator Toolbar and Menu Items"

When the Oracle Java ME SDK 8 EA 2 emulator starts, it appears with the Application Management System (AMS) tab selected as the default, as shown in Figure 3-2.

Figure 3-2 The Oracle Java ME SDK 8 EA 2 Emulator (AMS Tab) Default Screen

Description of Figure 3-2 follows
Description of "Figure 3-2 The Oracle Java ME SDK 8 EA 2 Emulator (AMS Tab) Default Screen"

Device Name. Shown in the upper left window frame.

Menus. The Menus available on the Oracle Java ME SDK 8 EA 2 emulators are:

Toolbar. The Toolbar provides shortcuts for the following operations:


Note:

When the Device Manager detects an external embedded device, only the Application, View, and Help menus and the Run IMlet Suite, Install IMlet Suite, and Emulator window always on top icons in the Toolbar are available in the device display.


Device ID. Numerical identifier that is unique for each device.

Phone Number. A number used by the emulator to send messages to itself for testing purposes.

Display Panel and Tabs. The display panel displays fields and information dependent on the selected tab:

Emulator Status Bar. Information about the current system state is shown in the status bar at the bottom of the emulator window. Also shown is the memory indicator showing used and total memory.

Run/Stop Button. A toggle button that can be used to start and stop an IMlet suite.

The AMS Tab

The first tab in the emulator, the AMS tab, displays which Oracle Java ME SDK 8 EA 2 applications are installed, running, or stopped.

You can use the buttons in the AMS tab, as shown in Figure 3-3, to do the following:

  • Install or Reload an application

  • Remove an application

  • Display Info about an application

  • Display Output about an application in a separately-displayed Output Console

Figure 3-3 Buttons on the AMS Tab

Description of Figure 3-3 follows
Description of "Figure 3-3 Buttons on the AMS Tab"

The Output Console Window

The Output Console window of the AMS tab allows you to display logging information about a selected application, as shown in Figure 3-4.

Figure 3-4 The AMS Tab Output Console

Description of Figure 3-4 follows
Description of "Figure 3-4 The AMS Tab Output Console"

Output Console information can be Error output, Standard output, or All output. The selected output can be saved to a file in your file system by selecting the Save button.

The GPIO Pins Tab

The GPIO tab lists the emulator's current General Purpose I/O (GPIO) pins and their directional state (output). For GPIO pins, the current value is shown as low or high. The GPIO Pins tab is shown in Figure 3-5.

Figure 3-5 The Emulator GPIO Pins Tab

Description of Figure 3-5 follows
Description of "Figure 3-5 The Emulator GPIO Pins Tab"

The GPIO Ports Tab

For GPIO ports, the port ID and port Name is shown, along with the port's Maximum Value and current Value. If you select the line that displays the available ports, it displays the pins bound to that specific port, as shown in Figure 3-6.

Figure 3-6 The Emulator GPIO Ports Tab

Description of Figure 3-6 follows
Description of "Figure 3-6 The Emulator GPIO Ports Tab"

Selecting the line that displays the available ports shows the pins bound to that port, as shown in Figure 3-7.

Figure 3-7 The GPIO Ports Bound Pins

Surrounding text describes Figure 3-7 .

The I2C Tab

The Inter-Integrated Circuit (I2C) tab emulates a simple peripheral slave device that echoes back any data that is sent to it. Both the sent and received data are shown in their appropriate window panes, as shown in Figure 3-8.

Figure 3-8 The Emulator I2C Tab

Description of Figure 3-8 follows
Description of "Figure 3-8 The Emulator I2C Tab"

The SPI Tab

The Serial Peripheral Interface (SPI) tab is similar to the I2C tab. It emulates a simple peripheral slave device that echoes back any data that is sent to it. Both the sent and received data are shown in their appropriate tabs, as shown in Figure 3-9.

Figure 3-9 The Emulator SPI Tab

Description of Figure 3-9 follows
Description of "Figure 3-9 The Emulator SPI Tab"

The MMIO Tab

The MMIO tab emulates the Memory-Mapped I/O (MMIO) interface bus. It displays an information table about the selected device, as shown in Figure 3-10.

Figure 3-10 The Emulator MMIO Tab

Description of Figure 3-10 follows
Description of "Figure 3-10 The Emulator MMIO Tab"

The ADC Tab

The Analog-to-Digital Converter (ADC) tab displays current Channel information, such as ID, Converter Number, Minimum and Maximum Values, Sampling Intervals, and more, as shown in Figure 3-11.

Figure 3-11 The Emulator ADC Tab

Description of Figure 3-11 follows
Description of "Figure 3-11 The Emulator ADC Tab"

The DAC Tab

The Digital-to-Analog Converter (DAC) tab displays current Channel information, such as Minimum and Maximum Values, Sampling Interval, Reference Voltage, and more, as shown in Figure 3-12.

Figure 3-12 The Emulator DAC Tab

Description of Figure 3-12 follows
Description of "Figure 3-12 The Emulator DAC Tab"

The PWM Tab

The Pulse Width Modulation (PWM) tab allows you to monitor a signal (pulse) that can be encoded for a specific width (duration). It displays information about a specific pulse counter, such as its configuration and current state, as shown in Figure 3-13.

To encode and send a pulse of a specific duration, use the PWM tab of the External Events Generator. For more information, see Chapter 4.

Figure 3-13 The Pulse Width Modulation Tab

Description of Figure 3-13 follows
Description of "Figure 3-13 The Pulse Width Modulation Tab"

The Pulse Counters Tab

The Pulse Counters tab allows you to send pulse information to as many as four counters. as shown in Figure 3-14. There are four kinds of pulses:

  • Falling Pulse Edge - Can only be bound to input pins with the Falling Edge trigger.

  • Rising Pulse Edge - Can only be bound to input pins with the Rising Edge trigger.

  • Negative Pulse Edge - Can only be bound to input pins with the Both Edges trigger.

  • Positive Pulse Edge - Can only be bound to input pins with the Both Edges trigger.

Figure 3-14 The Emulator Pulse Counters Tab

Description of Figure 3-14 follows
Description of "Figure 3-14 The Emulator Pulse Counters Tab"

The Displays and Input Devices Tab

The Displays and Input Devices tab allows you to gather information about specific displays attached to your device. This includes both primary and auxiliary displays. This tab also displays information about any input devices, such as a Qualcomm Orion IoE or Raspberry Pi embedded platform, as shown in Figure 3-15.

Figure 3-15 The Displays and Input Devices Tab

Description of Figure 3-15 follows
Description of "Figure 3-15 The Displays and Input Devices Tab"

Using the Menus

The menus on the Oracle Java ME SDK 8 EA 2 emulator allow you to do a number of operations, including running and installing IMlet suites, managing landmarks, file systems, and access points, and running the External Events Generator.

The Application Menu

The Application menu lets you install and run IMlet suites.

The Device Menu

The Device menu allows you to see messages in the Messages box that are directed at the currently-running emulator from other devices. Messages provide information such as the timestamp, subject, encoding, and other information, as shown in Figure 3-18.

Select Device > Messages to see what is written in the message area. Messages are sent to a device in the following cases:

  • An SMS message is sent without a port in the address (or the port number is 0)

  • An SMS text message is sent with a port in the address, but there is not a Java ME application listening on the specified port

To test sending messages to the device use the WMA Console in NetBeans 8.0 Beta, or from the command line, use wma-tool.exe to send SMS messages.

Figure 3-18 The View Menu Messages Box

Description of Figure 3-18 follows
Description of "Figure 3-18 The View Menu Messages Box"

The Tools Menu

The Tools menu allows you to manage landmarks, file systems, and access points. It also provides another way to launch the External Events Generator.

  • Manage Landmarks. Landmarks are used to emulate location information for an embedded device.

    You can use the default Landmark store, create new landmark stores, define landmark categories, and carry out other landmark operations, as shown in Figure 3-19.

    Figure 3-19 The Manage Landmarks Box

    Description of Figure 3-19 follows
    Description of "Figure 3-19 The Manage Landmarks Box"

  • Manage File System. Managing a file system allows you to mount a file tree to your emulation environment, providing access to components not installed in your immediate location.

    Once a file tree is mounted, it can also be unmounted, as shown in Figure 3-20.

    Figure 3-20 The Manage File System Box

    Description of Figure 3-20 follows
    Description of "Figure 3-20 The Manage File System Box"

  • Connectivity. Setting Connectivity allows you to define the network connectivity for your embedded emulation environment.

    As shown in Figure 3-21, four tabs are available on the Connectivity screen:

    • Access Points. Allows you to add and remove access points, and characteristics of a specific access point, such as the bearer type, network interface, and the service set ID (SSID).

    • Network Interfaces. Allows you to add and remove network interfaces, and define characteristics of a specific network interface, such as the type, timeout interval, and connection interface device.

    • Cellular Network. Allows you to add and remove a cellular network, and define characteristics for a specific cellular network, such as CDMA or 3GPP, connection protocol, and other details.

    • Subscribers. Allows you to add or remove a subscriber, and define characteristics for a subscribers, such as phone number, network type, international mobile subscriber identity (IMSI), and other details.

    Figure 3-21 The Connectivity Box

    Description of Figure 3-21 follows
    Description of "Figure 3-21 The Connectivity Box"

  • External Events Generator. For more information on the External Events Generator, see Chapter 4, "Using the External Events Generator"

The View Menu

The View menu allows you to view output in a device log or output console, to set your Embedded emulator so it always appears on top on your desktop, and show additional information on exit.

  • Output Console.... Allows you to see output from an application running in the emulator, as shown in Figure 3-22. You have three choices for filtering output: All, Standard Output, and Error Output.

    You can save system output information to a text file by clicking Save in the output window.

    Figure 3-22 The Output Console Window

    Description of Figure 3-22 follows
    Description of "Figure 3-22 The Output Console Window"

  • Device Log. Allows you to display logging info, as shown in Figure 3-23. You have several levels of logging to choose from, including Trace, Debug, info, Warn, Error, and Fatal.

    You can save log information to a text file by clicking Save in the output window.

    Figure 3-23 The Device Log Window

    Description of Figure 3-23 follows
    Description of "Figure 3-23 The Device Log Window"

  • Always on Top. Allows you to keep the emulator on top of other windows open on your desktop.

  • Show Hot Deployment Hint on Exit. Upon exit from the emulator, provides suggestions on how to save your work and easily restart the emulator.

The Help Menu

The Help menu allows you to get additional information about the Oracle Java ME SDK 8 EA 2 emulation environment. Put your cursor over any part of the Embedded emulator screen, and select Help > Help Contents.

Starting and Running Emulators

The Oracle Java ME SDK 8 EA 2 runs applications on an emulator or an external device.

The Device Connections Manager automatically starts detecting devices when Oracle Java ME SDK 8 EA 2 is installed. The default emulators are automatically found and displayed in the NetBeans 8.0 Beta Device Selector window (Tools > Java ME > Device Selector), as shown in Figure 3-24.

Figure 3-24 Available Devices in the NetBeans 8.0 Beta Device Selector

Description of Figure 3-24 follows
Description of "Figure 3-24 Available Devices in the NetBeans 8.0 Beta Device Selector"

The Device Selector can also be launched from the Windows command line. Enter the following:

C:\>Java_ME_platform_SDK_8.0_EA\bin\device-selector.exe

This displays the standalone Device Selector, as shown in Figure 3-25.

Figure 3-25 The Standalone Device Selector

Description of Figure 3-25 follows
Description of "Figure 3-25 The Standalone Device Selector"

Starting an Emulator

Typically an emulator is launched when a Oracle Java ME SDK 8 EA 2 project is run from the NetBeans 8.0 Beta IDE or from the command line. The default emulator is determined by the Java ME platform selected for the project.

You can open an emulator without running an application from the IDE. From the Windows Start menu, click Start > All Programs and select Java(TM) ME Platform SDK 8.0. On the pull-right menu, select the default emulator. You can also click the emulator shortcuts installed on your Windows desktop.

To run an application from the emulator, click the Application menu and select Run IMlet Suite. Provide the path to the application and any other information, and click OK.

The Qualcomm_IoE_Device Emulator

The Qualcomm_I0E_Device emulator is based on MEEP, but for a specific embedded platform, the Qualcomm Orion IoE device. Many of the menus and settings are the same as in the MEEP emulator.

The Qualcomm_IoE_Device emulator is launched from the Windows command prompt:

  1. Change to the bin directory of the Oracle Java ME SDK 8 EA 2 distribution:

    C:\>cd Java_ME_platform_SDK_8.0_EA\bin

  2. To start the Qualcomm_IoE_Device emulator without a running application, enter:

    C:\>emulator.exe -Xdevice:Qualcomm_IoE_Device -Xjam

  3. To start the Qualcomm_IoE_Device emulator with a running sample application, enter the following command, using the generic command line shown here:

    emulator.exe -Xdevice:Qualcomm_IoE_Device -Xdescriptor:location_of_jad_file

    For example, to start the GPIODemo sample application, enter the following:

    emulator.exe -Xdevice:Qualcomm_IoE_Device -Xdescriptor:C:\Java_ME_platform_SDK_8.0_EA\apps\GPIODemo\GPIODemo.jad

This launches the Qualcomm_IoE_Device emulator, as shown in Figure 3-26.

Figure 3-26 The Qualcomm_IoE_Device Emulator

Description of Figure 3-26 follows
Description of "Figure 3-26 The Qualcomm_IoE_Device Emulator"