Professional Documents
Culture Documents
J2ME - Introduction: Advanced Applications Development in Java
J2ME - Introduction: Advanced Applications Development in Java
J2ME - Introduction: Advanced Applications Development in Java
J2ME -- Introduction
CLDC MIDP
Examples
Michael Brockway
A version of the Java platform which supports small devices -- hand-helds, cell phones, pagers, embedded systems, ... The Connected Limited Device Configuration (CLDC)
a set of APIs for applications for devices with limited screens size, memory, power, bandwidth. Contains
the kilobyte virtual machine (KVM) packages java.io, java.lang, java.util small subsets of the corresponding J2SE packages
interfaces DataInput, DataOutput classes InputStream, DataInputStream, ByteArrayInputStream, InputStreamReader, PrintStream Reader exception, error classes etc
J2ME -- CLDC
interface Runnable classes Boolean Integer Runtime System interface Enumeration classes Calendar Random TimerTask
CLDC version 1.0 contained no floating point types, no serializable objects no thread groups no JNI CLDC 1.1 which appeared in March 2004 contains more features,
J2ME -- MIDP
APIs for programming mobile devices -- phones, Palm Pilots, ... Application software in MIDlets Package javax.microedition.lcdui contains GUI classes for devices with LCD screens
interfaces classes
CommandListener AlertType DataField Form ImageItem ScreenItem Canvas Display Gauge Item TextBox
J2ME -- MIDP
interfaces
class
J2ME -- MIDP
interfaces
class
RecordEnumeration RecordListener
Package javax.microedition.midlet contains the MIDlet class The minimum hardware for a MIDlet:
at least 96 X 54 pixels monochrome display a two-way wireless network an input device 128 kb for CLDC & MIDP classes at least 32 kb for the KVM
Graphics in a MIDlet
<<interface>>javax.microediiton.lcdui.Displayable
<<abstract>>
<<abstract>>
Screen
(high-level)
Canvas
(low-level) Alert
TextBox
List
Form
not a container, but we can override its paint method to use Graphics draw methods
a container of laid-out components
7
Practicalities
Exercises
Make a MIDlet which will display a multiplication table when an integer between 1 and 12 is input. Make a MIDlet which will do simple (+, -, X, /) calculations on two input numbers