2.4.2 Media API
MIDP includes the Media API which provides limited, audio-only mul-
timedia. It is a subset of the optional and much richer JSR-135 Mobile
Media API, which currently ships on most Symbian OS phones.
The MIDP Media API provides support for tone generation and audio
playback of WAV files if the latter is supported by the underlying hard-
ware. Since MIDP is targeted at the widest possible range of devices, not
just feature-rich smartphones, the aim of the Media API is to provide a
lowest common denominator of functionality suitable for the capabilities
of all MIDP devices. However, with the wide availability of JSR-135
MMAPI on Symbian OS devices, we look at both the Media and Mobile
Media APIs in detail later in this chapter, as the latter is much richer in
functionality and provides additional opportunities for development of
media-centric Java applications.
2.4.3 Networking - Generic Connection Framework
CLDC has defined a streamlined approach to networking, known as the
Generic Connection Framework (GCF). The framework seeks to provide
a consistent interface for every network connection between the MIDP
classes and the underlying network protocols. It doesn't matter what
kind of connection is being opened; the interface remains the same.
For instance, if you're opening a socket or an HTTP connection, you
are still going to use the same Connector.open() method. MIDP has
support for many protocols, although HTTP and HTTPS are mandatory.
Java ME on Symbian OS also supports other optional protocols, such as
sockets, server sockets and datagrams. Due to the implications of the
MIDP security model on networking APIs, these are discussed in more
detail in Section 2.6.
2.4.4 Push Registry
The Push Registry API allows MIDlets to be launched in response to
incoming network connections. Many applications, particularly mes-
saging applications, need to be continuously listening for incoming
messages. To achieve this in the past, a Java application would have had
to be continually running in the background. Although the listening Java
application may itself be small, it would still require an instance of the
virtual machine to be running, thus appropriating some of the mobile
phone's scarce resources. The JSR-118 group recognized the need for an
alternative, more resource-effective solution for MIDP and so introduced
the Push Registry. The Push Registry API is also affected by MIDP 2.0's
security model, therefore we discuss it in Section 2.7.