Overview of Java

Download Report

Transcript Overview of Java

PROGRAMMING WITH J2ME
Mr. K. Omieno
Sun Microsystems has defined three Java
platforms, to the needs of different of
computing environments:
 • 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.

 Small
computing devices differ greatly eg: in
terms of Memory, Storage Capability, display
and connectivity
 To address this, Java Community Process
Program( Sun’s group mandated to create
J2ME) came up with an achitecture.
 The J2ME architecture comprises three
software layers
1. Configuration layer
2. Profile Layer
3. Mobile Information Device Profile (MIDP)
Layer
J2ME ARCHITECTURAL LAYERS
 Basically
the Architecture comprises
 J2ME Configurations
 J2ME Profiles.
Configuration: defines the Java Virtual
Machine for a particular small computing
device.
2 configurations exist.
1. Connected Limited Device Configuration
(CLDC)
2. Connected Device Configuration (CDC).
16-bit or 32-bit small computing devices with
limited amounts of memory.
 160KB to 512KB of available memory .
 Battery powered.
 Use an inconsistent, small-bandwidth network
wireless connection
 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.

 CDC
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.
I.
Foundation Profile.
II.
Game Profile.
III.
Mobile Information Device Profile.
IV.
PDA Profile.
V.
Personal Profile.
VI. Personal Basis Profile.
VII. RMI Profile.
 The
most popular and well known of all the
profiles is the Mobile Information Device
Profile (MIDP), sometimes called the MID
Profile.
 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
input device
 128 KB nonvolatile memory for MIDP
components
 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
control)
 user interface
 persistent storage
 networking
 Timers








MIDP Package
Name Description
javax.microedition.lcdui
UI classes and
interfaces
javax.microedition.rms
Record management
system (RMS) supporting persistent device storage
javax.microedition.midlet
MIDP application
definition support class types
javax.microedition.io MIDP generic connection
framework classes and interfaces
java.io
Standard Java IO classes and interfaces
java.lang
VM classes and interfaces
java.util
Standard utility classes and interfaces
A
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
JAR(Java Archive)
These include;- Midlet classes, Icons and the
manifest file.
Manifest file has information required by the
Application manager to handle the midlets
such as name , version ,vendor ..etc
 Java
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
the midlet.
 Code
to Implement “Hello Word “ program
 What
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
their functions.
 Differentiate JAR from JAD files