|Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 3.4 for NetBeans on Windows
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).
Follow these steps to activate the network activity for an application.
In the Projects window, right-click a project and select Profile.
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
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
The top frame displays a list of messages. Click a message to display its details in the bottom frame.
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).
In the [Select Devices] list check only the devices you want to view.
In the [Select Protocols] list check only the protocols you want to view. The protocols listed reflect what is currently installed on the device.
Click the magnifying glass in the Network Monitor Toolbar to search for a specific string in the data in the Phone or URL columns.
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.
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
Select a file name. The default file extension is .
nmd (network monitor data).
Follow these steps to load a network monitor session:
Click the File menu and select Open File... .
Browse to the
.nmd file you saved.
To avoid memory issues, the Hex view display is currently limited to 16kB of data.
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).