Skip Headers
Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 8 for Windows
E50624-01
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

3 Using the Emulators

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.

Starting the 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.

Understanding the Main Window

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:

Below the menu bar is the toolbar with buttons that provide 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 buttons in the toolbar are available in the main emulator window.


Below the toolbar, there are two labels:

Below the Oracle logo, there are 11 tabs:

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.


Running Emulators

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

Description of Figure 3-1 follows
Description of "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

Description of Figure 3-2 follows
Description of "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.

Running the Qualcomm_IoE_Device Emulator

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:

  1. Open the bin directory under the Oracle Java ME SDK 8 installation directory:

    C:\> cd Java_ME_platform_SDK_8.0\bin
    
  2. 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