Java Reference
In-Depth Information
A Bridge to the Outside World
Many MIDP devices, especially mobile phones, have web browsers, using either the WAP or
HTTP protocol. The MIDlet class supplies a bridge to these browsers and other capabilities:
public final boolean platformRequest(String URL)
throws ConnectionNotFoundException
On a sophisticated device, the browser and the MIDlet suite may be able to run at the same
time, in which case the browser will be launched and pointed to the specified URL. In this case,
the method returns true.
On smaller devices, the browser may not be able to run until the MIDlet is destroyed. In
this case, platformRequest() returns false, and it's the MIDlet's responsibility to terminate.
After the MIDlet terminates, it's the implementation's responsibility to launch the browser and
point it at the specified URL.
In either case, platformRequest() is a nonblocking method.
There are two special possibilities for the supplied URL. If you supply a telephone number
URL of the form tel:<number> as specified in RFC 2806 ( http://ietf.org/rfc/rfc2806.txt ),
the implementation should initiate a voice call.
If you supply the URL of a MIDlet suite descriptor or JAR, the implementation should
eventually start the application manager and attempt to install the given MIDlet suite (after
asking for your permission, of course).
Packaging MIDlets
MIDlets are deployed in MIDlet suites . A MIDlet suite is a collection of MIDlets with some extra
information. There are two files involved. One is an application descriptor , which is a simple
text file. The other is a JAR file that contains the class files and resource files that make up your
MIDlet suite. Like any JAR file, a MIDlet suite's JAR file has a manifest file. Figure 3-2 shows a
diagram of a MIDlet suite.
Figure 3-2. Antatomy of a MIDlet suite
Search WWH ::




Custom Search