6
Network API
Notes
It is important to take into consideration the blocking nature of many javax.microedition.io
and java.io object methods with regards to networking applications. It is advisable to
spawn another thread specifically dedicated to retrieving data in order to keep the user
interface interactive. If a single thread is used to retrieve data on a blocking call, the user
interface becomes inactive with the end-user perceiving the application as "dead".
Reading from an
the length of the data is known. For example, if the content length is provided in the
header of the
read the data.
The
InputStream
be completely closed.
An application in the paused state can still continue to actively use the networking
facilities of the Motorola C370, C450, and C550 series of handsets.
The platform does not support simultaneous voice and data transmissions.
using an array is faster then reading byte by byte, when
InputStream
, then an array of the specified size can be used to
HttpConnection
and
OutputStream
as well as the
Connection
object need to
35