Information Technology Reference
In-Depth Information
Displayable
Canvas
Screen
GameCanvas
Alert
Form
List
TextBox
Fig. 1.
Class diagram: basic MIDP GUI elements
CommandListener
1
0..1
MIDlet
Display
Displayable
1
1
1
1
Command
1
0..*
Fig. 2.
Class diagram: relation between midlets, displays, and screens
setCurrent(Alert alert, Displayable nextDisplayable)
, which will dis-
play the
alert
, and then show the
nextDisplayable
.
In its turn, a
Displayable
object may have a
CommandListener
associ-
ated with it, which implements a method
void commandAction(Command c,
Displayable d)
to handle incoming command events occurring on some
Disp-
layable d
.
Commands
are user actions, such as buttons that the user can se-
lect on the screen. Fig. 2 shows the relevant class structure. Note that control
passes back and forth between the midlet and the platform. When a midlet
calls
setCurrent(...)
to change the display, it hands over control to the plat-
form; when after that a user action occurs, the platform hands back control to
the midlet by a call back to
commandAction(...)
. The behaviour of the mi-
dlet is determined by: (i) the current
MIDlet
and its
Display
, (ii) the current
Displayable
shown on that
Display
, (iii) the
Commands
that the midlet pro-
vides (if any), (iv) the associated
CommandListener
(if any). The display and the
midlet should never change. The MIDP platform controls which
Displayable
is
shown, and offers a midlet API calls to change it; the midlet is in charge of the
Commands
and
CommandListeners
and their associations to
Displayables
.
Sensitive Operations.
The second relevant part of the MIDP infrastructure
are the APIs responsible for network communication and personal information
management. These operations are possibly security-sensitive. An unwanted or
uncontrolled network communication may result in (a) sensitive data being sent
out from the phone, or (b) unwanted network usage charges. Access to personal
information (e.g. the phone book) may result in unwanted information leakage.
The high level API structure for network communication is very simple. In
principle it only involves the
Connector
class that provides static methods for
Search WWH ::
Custom Search