introduction to mobile programing (j2me)

18
PROGRAMMING WITH J2ME

Upload: wambua-wambua

Post on 05-Jul-2015

83 views

Category:

Technology


0 download

TRANSCRIPT

Page 2: Introduction to mobile programing (J2ME)

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 micro-

computers.

Page 4: Introduction to mobile programing (J2ME)

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

Page 5: Introduction to mobile programing (J2ME)

J2ME ARCHITECTURAL LAYERS

Page 6: Introduction to mobile programing (J2ME)

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).

Page 7: Introduction to mobile programing (J2ME)

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.

Page 8: Introduction to mobile programing (J2ME)

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.

Page 9: Introduction to mobile programing (J2ME)

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.

Page 10: Introduction to mobile programing (J2ME)

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.

Page 11: Introduction to mobile programing (J2ME)

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 application-

persistent data(DB)

32 KB volatile runtime memory for Java heap

two-way wireless connectivity

Page 12: Introduction to mobile programing (J2ME)

The MIDP, specifies the following APIs:

application (MIDP application semantics and

control)

user interface

persistent storage

networking

Timers

Page 13: Introduction to mobile programing (J2ME)

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

Page 14: Introduction to mobile programing (J2ME)

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

Page 15: Introduction to mobile programing (J2ME)

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.

Page 16: Introduction to mobile programing (J2ME)

Code to Implement “Hello Word “ program

Page 17: Introduction to mobile programing (J2ME)
Page 18: Introduction to mobile programing (J2ME)

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