CartesianListener listener = new CartesianListener();
listener.setLookAt(new Vector3D(0f, 0f, 0f), new Vector3D(0f, 0f, -1f),
new Vector3D(0f, 1f, 0f));
cartPos = new CartesianPosition(listener);
7.8.5 Serial Communications (UART)
Some FOMA handsets are equipped for serial communications via a
cable (Universal Asynchronous Receiver/Transmitter, UART) connection.
For supported handsets, data can be transferred to a PC via USB cable
by opening a connection using the Connector.open() methods and
passing in a URL in the following form:
comm:/0 [ ; parameter, ... ]
InputStream in = Connector.openDataInputStream("comm:/0;baudrate=38400");
int flag = in.read();
7.8.6 DTV and Radio Tuner
For handsets equipped with digital television tuners, the DoJa 5.x API
includes DTV launch integration features, as well as allowing for the
registration of recording timers.
Handsets may optionally be equipped with radio tuners, which can
also be controlled via the DoJa 5.x API. This is new functionality added
in DoJa 5.0. The radio can be used in stand-by applications and is set to
continue playback even when the phone is in a dormant state.
7.8.7 Acceleration Sensor and Electronic Compass
The electronic compass is an optional feature added in the DoJa 5.0
profile. It provides the ability to collect the kind of location information
associated with a traditional compass.
Perhaps one of the more exciting new features of the DoJa 5.1 pro-
file is the acceleration sensor. This sensor allows for the collection of
acceleration data along the x, y, and z axes, as well as pitch and roll infor-
mation, and screen orientation. This functionality appears to be clearly
directed towards game developers and allows for some quite engaging
and innovative applications.
The following simple program uses the acceleration sensor to deter-
mine the orientation of the phone. The program draws an arrow on the