Java Reference
In-Depth Information
They need to match the connection properties of the connected device. For debugging purposes, the
mobile device can easily be connected to the desktop PC using a serial RS232 connection, as shown in
Figure 6.3 . Using a terminal program such as Hyperterm (included in MS Windows), the transferred
data can be visualized on the host computer system.
Figure 6.3. The mobile device connected to a desktop PC for sending and receiving
data using a terminal application such as Hyperterm.
Note
The CommConnection that is used in PDAP is also available in MIDP 2.0.
File Connections
A new kind of connection that is added to the Generic Connection Framework by PDAP is the
capability to access file-based memory cards or the internal file system of a device. Currently, most of
the new handheld devices are equipped with some kind of card reader supporting one or even two
different brands of removable media cards such as
• CompactFlash cards
• MultiMedia cards
• Secure Digital cards
• SmartMedia cards
• and MemorySticks
Those cards support a hierarchical file system similar to the file system known from desktop computers.
PDAs may also provide an internal file system.
For access to file systems, the three interfaces FileConnection , FileSystemEvent and
FileSystemListener are included in PDAP. Those interfaces and the additional
FileSystemRegistry class are described in detail in the following sections.
The FileConnection Interface
The FileConnection interface defines methods for handling files on removable media, similar to
the functionality provided by the java.io.File class of the Java 2 Standard Edition. For opening a
file connection using the Connector class, a URL consisting of the following parts needs to be
passed:
file://<host>/<path>
 
Search WWH ::




Custom Search