You are on page 1of 32

INTRODUCTION TO J2ME

Software Engineering Division Centre for Development of Advanced Computing E-City, Bangalore

Agenda
Java Editions Introduction to J2ME Where J2ME is Used Java Landscape and Java Editions J2ME Architecture J2ME Core Concepts Configurations Profiles

Java Editions
Java2 Platform

J2SE
Desktop and ClientServer Applications

J2EE
Enterprise Server Applications

J2ME
Small and Constrained Device Applications

Java Editions ...


Each Java Edition defines Different set of Class Libraries
J2EE

J2SE

J2ME

Introduction to J2ME
We can define J2ME as Sun's version of Java aimed at devices: With limited hardware resources With less memory With Processors less powerful than desktop and server machines

Java vs J2ME
J2ME is the reduced version of java with some additional APIs added . Java can be installed and uninstalled in the machines ,but J2ME has to be embedded in the devices by device manufacturers. Java class Verification is a single-step process whereas the J2ME class file Verification is a two-step process.
Off-device Verification. On-device Verification

J2ME-Preverification
Due to memory and processing power constraints the verification process of classes in devices is split into two processes.
Preverification :this is done off-device The Second process is on device verification

Some of the J2ME Enabled Devices

Mobile Phone High End PDA Low-End PDA Vehicle Navigation System

Pager

Internet TV

Palm-Top

Set-Top Box
8

J2ME Enabled Devices(Contd...)

Point-Of-Sale Systems Smart Phones

Microwave oven

BlackBerry

Vehicle Entertainment System


9

The Java Landscape


Servers & Enterprise Computers Optional Packages Servers & Personal Computers Optional Packages Java 2 Platform Standard Edition (J2SE) High end PDAs TV Set-Top Boxes Embedded Devices Optional Packages
Personal Profile Personal Basis Profile

Mobile Phones Smart Cards &Entry level PDAs

Java 2 Platform Enterprise Edition (J2EE)

Optional Packages MIDP CLDC KVM Java Card Card VM

Foundation Profile CDC JVM JVM JVM

Java 2 Platform Micro Edition

10

Comparison of Virtual Machines


Feature Processor JVM(HotSpot) 64/32 bit 166 MHz- JVM(CDC) 32 bit >25 MHz 1MB-16MB -min 256KB -min 512KB KVM 16/32 bit 16-32 MHz 160KB-512KB -min 32KB -min 128KB CardVM 8/16 bit 1-5 MHz -min 512 B -min 24KB

Memory -RAM -ROM

32MB- min 32MB

Persistent Memory

100MB-

1MB-5MB

1MB-2MB

16KB EEPROM

Virtual Machine Size

100-200 KB

100-200KB

<128 KB

6-8 KB

11

Components of J2ME
There are different variations in devices in terms of Memory Processor User Interface Power Consumption To support these differences, J2ME introduced the concept of Configurations Profiles Optional Packages
12

J2ME Architecture
To increase flexibility of design J2ME introduced two layers Configurations Profiles Configuration:Defines minimum Java technology for a broad range of devices Profiles:Provides Capabilities on top of Configuration for a specific device type
13

Configurations
A Configuration defines a minimum Java platform for a family of devices. A Configuration is a Specification that identifies the System level facilities such as: Set of Java language features Set of Java Virtual Machine Features. They provide the base functionality for a particular range of devices that share similar characteristics like: Memory Processing Capacity Network Connectivity
14

Configuration Types
Configurations

CLDC

CDC

For personal,intermittently connected mobile devices like mobile phones,pagers, PDAs,Organizers

For constantly connected Network devices like TV set-Top boxes, vehicle Navigation Systems

15

J2SE & Configurations


java.lang, java.util, java.io J2SE

CDC CLDC

javax.microedition.io

16

CDC
It requires a minimum memory of 512 kilobytes for running Java It requires a minimum of 256 kilobytes for runtime memory allocation. It specifies the use of full Java 2 platform VM, which is called Compact Virtual Machine(CVM)

17

It supports personal, mobile devices which constitute a less powerful class of devices than the one that CDC supports Identifies devices having features: 128 kilobytes memory for running java 32 kilobytes for runtime memory allocation Restricted User Interface 16-bit or 32-bit processor Low power Consumption ,typically battery powered Intermittent network connectivity(often wireless) with potentially limited bandwidth
18

CLDC

CLDC(Contd...)
Java Application MIDP CLDC Operating System 1.Core Java lang Specification 2.Virtual Machine Features 3.Core java libraries java.lang.*, java.util.* 4. I/O & Networking 5.Security & Internationalization

19

Features Missing in CLDC


Floating point calculations(Supported in CLDC 1.1) Weak references (Supported in CLDC 1.1) Object finalization Java.lang.Error class in its entirety Reflection User defined Class loaders Java Native Interface Thread groups and thread daemons Class File Verification
20

KVM
KVM means Kilobyte virtual Machine. Designed to handle special considerations of the resource-constrained devices. An implementation that meets the CLDC Requirements. Some of the features of it are: It requires only 40-80 kilobytes of memory Only 20-40 kilobytes of heap is required. Can run on 16-bit processors clocked at only 25 MHz

21

Profiles
A Profile is an extension to a Configuration. It provides the libraries for the developer to create User Interface Persistent Storage Input and Event Handling Networking and Timers. Each Profile define particular device: Mobile Phones PDAs Organizer
22

Profiles(Contd...)
In short ,Profile is minimum set of class libraries required for the particular type of device Some of the Profiles are: MIDP PDAP Foundation Personal The Widely Adopted Profile is MIDP(Mobile Information Device Profile) We can use more than one profile at a time
23

MIDP
MIDP layers atop CLDC and defines a set of user interface APIs. MIDP applications are called MIDlets MIDP targets mobile information devices with following charactersistics Screen size of approximately 96*54 pixels One or two handed keyboard,touchscreen 128 KB nonvolatile memory 32 KB heap size Two-way wireless connectivity

24

MIDP(Contd...)
Java Application MIDP CLDC Operating System 1.User Interface (High & Low level API) 2.Persistent Storage 2.Persistent Storage 3.Networking 3.Networking 4.Application life cycle 4.Application life cycle Management Management

Two versions of MIDP are:


MIDP 1.0 MIDP 2.0
25

MID Profile Architecture


Profile Configuration MID Profile

CLDC Core Libraries K Virtual Machine(KVM) Host Operating System

Java Virtual Machine Host Operating System

Generic J2ME Architecture

MID Profile Architecture

26

Optional Packages
Support special capabilities of a device Sometimes VendorSpecific Designed for a specific Configuration/Profile The examples of optional packages may include Bluetooth API Wireless Messaging API Mobile Media API Location API
27

JTWI
JTWI means Java Technology for Wireless Industry This is part of Java Community Process(JSR 185) Its goal is defining a industry standard Java platform for mobile devices. Its main goal is to reduce the need for Proprietary APIs and providing a clear specification that phone manufacturers ,network operators and developers can target.

28

JTWI(Contd...)
Required JSRs JSR 30CLDC 1.0(CLDC 1.1 can also be used) JSR 118-MIDP 2.0 JSR 120-WMA 1.1 Optional JSRs JSR 135MMAPI 1.1 Benefits Interoperability Clarification of Security specification RoadMap
29

MSA
MSA means Mobile service Architecture which is the platform for mobile devices after JTWI. Collection of JSRs that cooperate to support applications for a wide range of standardized capabilities It broadens the architecture defined by JSR 185 to incorporate new technologies for high volume mobile devices.

30

Mobile Service Architecture Stacks

31

References
http://developers.sun.com/mobility/getstart/ http://java.sun.com/javame/technology/index.jsp http://java.sun.com/products/cldc/overview.html http://developers.sun.com/mobility/midp/articles/jtwi/ http://developers.sun.com/mobility/midp/articles/msaintro/

32

You might also like