Introduction to Mobile programming(J2ME)Presentation Transcript
PROGRAMMING WITH J2ME
Sun Microsystems has defined three Java
platforms, to the needs of different of
• Java 2 Standard Edition (J2SE)-(Desktops)
• Java 2 Enterprise Edition (J2EE)-(server-client)
• Java 2 Micro Edition (J2ME)-(Small computing
Devices eg Mobiles,PDAs,etc)
J2ME : a reduced version of the Java API and
Java Virtual Machine that is designed to operate
within the sparse resources available in the new
breed of embedded computers and microcomputers.
computing devices differ greatly eg: in
terms of Memory, Storage Capability, display
To address this, Java Community Process
Program( Sun’s group mandated to create
J2ME) came up with an achitecture.
The J2ME architecture comprises three
1. Configuration layer
2. Profile Layer
3. Mobile Information Device Profile (MIDP)
J2ME ARCHITECTURAL LAYERS
the Architecture comprises
Configuration: defines the Java Virtual
Machine for a particular small computing
2 configurations exist.
1. Connected Limited Device Configuration
2. Connected Device Configuration (CDC).
16-bit or 32-bit small computing devices with
limited amounts of memory.
160KB to 512KB of available memory .
Use an inconsistent, small-bandwidth network
May not have a user interface.
Use the KJava Virtual Machine (KVM)
implementation, which is a stripped-down
version of the JVM.
They include pagers, personal digital assistants,
cell phones, dedicated terminals, and handheld
consumer devices with between 128KB and
512KB of memory.
devices use a 32-bit architecture.
At least 2MB of memory available.
Implement a complete functional JVM.
They include digital set-top boxes, home
appliances, navigation systems, point-of-sale
terminals, and smart phones.
A profile: consists of Java classes that enable
implementation of features for either a
particular small computing device or for a
class of small computing devices.
Several profiles exist.
Mobile Information Device Profile.
VI. Personal Basis Profile.
VII. RMI Profile.
most popular and well known of all the
profiles is the Mobile Information Device
Profile (MIDP), sometimes called the MID
The MIDP layers and the CLDC and defines a
set of user interface (UI) APIs designed for
contemporary wireless devices.
MIDP applications are called MIDlets.
A MIDlet is a Java application that uses the
MIDP profile and the CLDC configuration.
screen size at least 96x54 pixels
display depth of 1 bit
One or two-handed keyboard, touch screen
128 KB nonvolatile memory for MIDP
8 KB nonvolatile memory for applicationpersistent data(DB)
32 KB volatile runtime memory for Java heap
two-way wireless connectivity
The MIDP, specifies the following APIs:
application (MIDP application semantics and
UI classes and
system (RMS) supporting persistent device storage
definition support class types
javax.microedition.io MIDP generic connection
framework classes and interfaces
Standard Java IO classes and interfaces
VM classes and interfaces
Standard utility classes and interfaces
single application could have many Midlets.
Midlets are bundled into a Midletsuit
contained within a single package.
All files necessary to implement a midlet suit
are contained in a production package called
These include;- Midlet classes, Icons and the
Manifest file has information required by the
Application manager to handle the midlets
such as name , version ,vendor ..etc
application descriptor (JAD) file can be
included within the JAR.
Used to pass parameters to a MIDlet without
modifying the JAR file .
Provides the application manager with
additional content information about the JAR
file to determine whether the MIDlet suite
can be implemented on the device.
Attributes include : name , vendor,version of
to Implement “Hello Word “ program
is J2ME,How does it differ from J2EE?
Explain the architecture of J2ME
What is a Profile?
What is a Configuration?
Compare CDC devices to CDLC devices giving
examples of each device category
What is a MIDLET?
What is MIDP?
What are the Java Packages used in MIDP and
Differentiate JAR from JAD files