Oracle® Java Micro Edition Software Development Kit Developer's Guide Release 8 for Windows E50624-01 |
|
Previous |
Next |
The Oracle Java ME SDK 8 embedded emulation environment provides you with a platform to test and run Oracle Java ME Embedded Profile (MEEP) IMlet suites without installing 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 Internet-of-Everything (IoE) embedded hardware device. For more information, see Oracle Java ME Embedded Getting Started Guide for the Reference Platform (Qualcomm IoE).
This chapter describes how to run and use the Java ME Embedded Emulator.
If the Embedded emulator is not displayed when you run the sample project described in Chapter 2, "Creating a Java ME SDK 8 Sample Project", it can be started from the Windows command line. For more information, see Appendix A, "Using the Command-Line Emulator".
Alternatively, click the Windows Start menu, select All Programs, open the Java ME Platform SDK 8.0 folder, and then select Java ME Embedded Emulator.
You can also run emulator.exe
under bin
in the Java ME SDK installation directory. The default location is C:\Java_ME_platform_SDK_8.0\bin\emulator.exe
.
The main window of the Java ME Embedded Emulator is shown in Figure 2-1. The name of the current emulated device is displayed in the title of the main window (for example, EmbeddedDevice1).
The menu bar contains the following menus:
Application: Used to install and run IMlet suites, and to exit the emulator.
Device: Used to view messages addressed to the device through the JSR 120: Wireless Messaging API (WMA).
Tools: Used to manage landmarks, the file system, connectivity, and start the External Events Generator.
View: Used to configure desktop and exit behavior, view output from a running application, and view logging information from the emulated device.
Help: Used to open the context-sensitive help, and view the Java ME SDK release and copyright information.
Below the menu bar is the toolbar with buttons that provide shortcuts for the following operations:
Run IMlet suite
Install IMlet suite
Start the External Events Generator
Always display the emulator window on top of other windows
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 buttons in the toolbar are available in the main emulator window. |
Below the toolbar, there are two labels:
Device ID: A numerical identifier that is unique for each device
Phone Number: A number used by the emulator to send messages to itself for testing purposes
Below the Oracle logo, there are 11 tabs:
AMS: The Application Management System (AMS) tab displays a table that lists installed IMlet suites, showing the name of the suite and IMlet, and its status. This is the default tab that opens when you start the Java ME Embedded Emulator. You can select a suite and perform one of the following operations by clicking the corresponding button to the right of the table:
Install: Specify the path or URL to the IMlet suite location and the security domain to load the IMlet suite into the emulator.
Reload: Reload the selected suite.
Remove: Remove the selected suite.
Info: Display information about the selected suite.
Output: Open the output console of the selected suite.
At the bottom of the AMS tab, there is a button that can be used to start and stop an IMlet suite. It is labeled either Start or Stop.
GPIO Pins: The General Purpose Input/Output (GPIO) Pins tab displays which pins are configured for input/output, their values, and which port they belong to.
GPIO Ports: The GPIO Ports tab displays a list of ports, port direction (input/output), and their maximum and current values.
I2C: The Inter-Integrated Circuit (I2C) tab displays information for the selected slave device, data sent to a master device, and data received from a master device.
SPI: The Serial Peripheral Interface (SPI) tab displays information for the selected slave device, data sent to a master device, and data received from a master device. If you have created a custom implementation with the Custom Device Editor, the Slave drop-down list might have additional slaves.
MMIO: The Memory-Mapped Input/Output (MMIO) tab displays memory configuration and memory content for the selected device.
ADC: The Analog-to-Digital Converter (ADC) tab displays the current channel, converter number, sampling intervals, minimum and maximum values, and other information.
DAC: The Digital-to-Analog Converter (DAC) tab displays the current channel information, converter characteristics, and a graphic display of signal characteristics with the x-axis showing the digital input and the y-axis showing the analog output.
PWM: The Pulse Width Modulation (PWM) tab displays the amount of electrical power flowing to a device.
Pulse Counters: The Pulse Counters tab displays the identifier, counter name, counter number, counter type, and the pins to which the counters are bound.
Displays and Input Devices: The Displays and Input Devices tab shows information about specific displays and input devices attached to your emulated device, including both primary and auxiliary displays.
Below the tabs, the emulator status bar contains information about the power state, and the memory indicator showing used and total heap memory.
Note: For more information about the Java ME Embedded Emulator GUI, open the Help menu and select Help Contents to see the help topics. For context-sensitive help, press F1. This will open the topic for the window or tab that is currently open. |
Oracle Java ME SDK 8 runs applications on an emulator or an external device. The Device Manager automatically starts detecting external devices when Oracle Java ME SDK 8 is installed. The default emulators are automatically found and displayed in the Device Selector window.
To view the Device Selector in NetBeans IDE, open the Tools menu, select Java ME, and then Device Selector. The Device Selector window is shown in Figure 3-1.
Figure 3-1 Available Devices in the NetBeans IDE 8.0 Device Selector
Alternatively, run the device-selector.exe
file under bin
in the Java ME SDK installation directory. For example, you can use the following command:
C:\> Java_ME_platform_SDK_8.0\bin\device-selector.exe
This command displays the standalone Device Selector, as shown in Figure 3-2.
Figure 3-2 The Standalone Device Selector
When an Oracle Java ME SDK 8 project is run from NetBeans IDE 8.0 or from the command line, the default emulator starts (it is defined by the Java ME platform selected for the project). If you do not want to use the default emulator, right-click any emulator in the Device Selector window, and select the project or JAR file with the application you want to run.
To open an emulator without running an application, run the emulator.exe
file under bin
in the Java ME SDK installation directory. For example, to run the EmbeddedDevice1 emulator, use the following command:
C:\> Java_ME_platform_SDK_8.0\bin\emulator.exe -Xjam -Xdevice:EmbeddedDevice1
Alternatively, you can double-click the emulator shortcut installed on your Windows desktop, or use the shortcut in the Start menu under All Programs in the Java ME Platform SDK 8.0 folder.
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 is based on MEEP, but for a specific embedded platform, the Qualcomm IoE device. Many of the menus and settings are the same as in the MEEP emulator.
To run the Qualcomm_IoE_Device emulator from the Windows command line:
Open the bin
directory under the Oracle Java ME SDK 8 installation directory:
C:\> cd Java_ME_platform_SDK_8.0\bin
To start the Qualcomm_IoE_Device emulator without running an application, use the following command:
C:\> emulator.exe -Xdevice:Qualcomm_IoE_Device -Xjam
To start the Qualcomm_IoE_Device emulator with a running application, use the -Xdescriptor
option. For example, to run the DataCollectionDemo
sample application, use the following command:
C:\> emulator.exe -Xdevice:Qualcomm_IoE_Device -Xdescriptor:C:\Java_ME_platform_SDK_8.0\apps\DataCollectionDemo\DataCollectionDemo.jad