Skip Headers
Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 3.4 for NetBeans on Windows
  Go To Table Of Contents
Go To Index


10 Network Monitoring

MIDP applications, at a minimum, are capable of HTTP network connections, but many other types of network connections are also possible. The network monitor provides a convenient way to see the information your application is sending and receiving on the network. This is helpful if you are debugging network interactions or looking for ways to optimize network traffic.

Networking monitoring works for emulators only (it is not supported for external devices).

10.1 Monitor Network Traffic

Follow these steps to activate the network activity for an application.

  1. In the Projects window, right-click a project and select Profile.

  2. If this is the first time profiling this application you are prompted to integrate the profile with the project. Click Yes to perform the integration.

    In the Profile window, select Network Monitor, and click Run.

    Figure 10-1 Activating Network Activity

    Description of Figure 10-1 follows
    Description of "Figure 10-1 Activating Network Activity"

  3. Start your application.

    When the application makes any type of network connection, information about the connection is captured and displayed in the Network Monitor tab.

    Figure 10-2 The Network Monitor Tab

    Description of Figure 10-2 follows
    Description of "Figure 10-2 The Network Monitor Tab"

    The top frame displays a list of messages. Click a message to display its details in the bottom frame.

    In the Hex View, message bodies are shown as raw hexadecimal values with the equivalent text.


    You can examine messages that are still in the process of being sent. Incomplete messages are indicated by bold highlighting in the message tree.

    You can view information up to a specific delimiter or back to a previous delimiter by clicking the Find Previous(Shift+F3) Occurrence or Find Next Occurrence(F3) icons in the Toolbar (between the Find Results and Clear Inactive Connection icons).

10.2 Filter or Sort Messages

Filters are useful for examining some subset of the total network traffic.

Time. Messages are sorted in chronological order of time sent or received.

URL. Messages are sorted by URL address. Multiple messages with the same address are sorted by time.

Click on a table header to sort the message data.

10.3 Save and Load Network Monitor Information

To save your network monitor session, click the Save Snapshot or Save As a Snapshot icon at the left of the Network Monitor Toolbar.

Figure 10-3 The Network Monitor Toolbar

Description of Figure 10-3 follows
Description of "Figure 10-3 The Network Monitor Toolbar"

Select a file name. The default file extension is .nmd (network monitor data).

Follow these steps to load a network monitor session:

  1. Click the File menu and select Open File... .

  2. Browse to the .nmd file you saved.


To avoid memory issues, the Hex view display is currently limited to 16kB of data.

10.4 Clear the Message Tree

To remove all inactive protocol records from the network monitor select the clear icon (the broom icon on the right of the Network Monitor Toolbar).