Java 2 Micro Edition (J2ME) or Java ME - Google Sites

2 downloads 139 Views 159KB Size Report
Java 2 Micro Edition (J2ME) or. Java ME. Rohan Chandane [email protected]. These notes are created by me, Ro
Java 2 Micro Edition (J2ME) or Java ME Rohan Chandane [email protected]

These notes are created by me, Rohan Chandane as learning material while pursuing MSc (CA) from SICSR. (CC) 2005-07

Basics 

Sun's version of Java aimed at machines 

 

with limited hardware resources (PDAs, Cell Phones, Embedded devices) with less memory (128KB of RAM) with processors less powerful than desktop and server machines

Continued… 



A highly optimized Java runtime environment The collection of virtual machines, APIs and related elements that provide Java to handheld and embedded computing devices

Components of J2ME 

There are different variation in devices in terms of  



Memory Processor

To support these differences, J2ME introduced the concept of   

Configurations Profiles Optional Package

Continued… 

Configurations 

Provide the base functionality 

For a particular range of devices that share similar characteristics like  



Memory Network Connectivity

Two J2ME configurations  

Connected Limited Device Configuration (CLDC) Connected Device Configuration (CDC)

Continued… 

Profiles   

Profiles refers to APIs for a specific domain That sits on top of a given configuration Providing 

Specific features  



Application life-cycle model User interface

Capabilities  

Persistent storage Access to device

Continued… 

Each profile define particular device   





Cell phones PDAs Microwave ovens, etc.

In short, Profile is minimum set of class libraries required for the particular type of device Widely adopted profile 

Mobile Information Device Profile (MIDP)

Continued… 

We can use more than one profile at a time 

Provided that the virtual machine and device supports the functionality for the additional profile

Continued… 

Optional Package 



Extend the J2ME platform by adding extra functionality Offer standard APIs for using both existing and emerging technologies like     

Database connectivity Wireless messaging Multimedia 3D graphics Web Services

The J2ME Platform

Details about Configuration 

Connected Limited Device Configuration (CLDC) 

For small wireless devices with intermittent (periodic) network connections  



Mobile phones Personal digital assistants

Mobile Information Device Profile (MIDP), which is based on CLDC

Continued… 

Typical characteristics of a device that implements the CLDC  

   

128 KB of memory for running Java programs 32 KB of memory for run time memory allocation 16-/32-bit RISC/CISC processor A limited user interface Runs on battery power Some form of wireless network connection, low bandwidth

Continued… 

Support in CLDC 

Support floating point math  

CLDC 1.0 specification – does not support CLDC 1.1 specification – does support

Continued… 

Connected Device Configuration (CDC) 

For larger devices in terms of memory and processing power with robust network connections   

 

Set-top boxes Internet appliances Embedded servers

Foundation Profile extends CDC It provides core APIs shared with Java SE

Continued… 

Typical characteristics of a device that implements the CDC 





512 kilobytes (minimum) memory for running Java programs 256 kilobytes (minimum) for run time memory allocation Network connectivity, possibly persistent, and high-bandwidth

Details about Profiles  

Profiles have been defined for J2ME Built upon CLDC  



Mobile Information Device Profile (MIDP) KJava

Built upon CDC  

Foundation Profile Personal Profile

Continued… 

Mobile Information Device Profile (MIDP)  

APIs built on top of the CLDC configuration Defines following APIs for cellular devices    

 

User Interface Components Input and Event handling Persistent storage Networking and timers

Common, industry-standard profile Not dependent on a specific vendor

Continued… 

Versions of the MIDP specification 

Version 1.0 



Original specification

Version 2.0  

Addressed many of the shortcomings Backwards compatible with version 1.0

Continued… 

MIDP contains the following packages 

Core CLDC packages   



java.lang java.io java.util

MIDP-specific packages    

javax.microedition.io javax.microedition.lcdui javax.microedition.midlet javax.microedition.rms

Continued… 

KJava   

Sun's proprietary profile Built on top of the CLDC configuration Contains a Sun-specific API 



Which runs on the Palm OS

It is not a standard J2ME package 

Main package is com.sun.kjava

Continued… 

Foundation Profile 



Intended for embedded and headless devices For devices that have no user interface  



Routers Gateway devices

There are other profiles, such as Personal Profile, that are intended to run on top of the Foundation profile

Continued… 

Personal Profile 



Personal Profile is the JavaME replacement for PersonalJava Defines a minimal set of user interface APIs

Java editions & Applications

JCP & JSR 

Configurations and Profiles are defined by Java Community Process (JCP) 



JCP - Open industry working groups utilizing Sun's Java Community Process Program This program is formed by an expert group consisting of representatives from participating companies

Continued… 



In this way industries can decide for themselves what elements are necessary to provide a complete solution targeted at their industry

Specifications for J2SE, J2EE and J2ME are developed under the JCP

Continued… 



 

Specification begins life as a Java Specification Request (JSR) JSR then passes through various stages in the JCP before it is finalized Every JSR is assigned a number J2ME specifications are commonly referred to by their JSR number

K Virtual Machine (KVM) 

For CDC 





The virtual machine has the same specification as J2SE That is Java Virtual Machine (JVM)

For CLDC 



Sun has developed a reference implementation of a virtual machine, known as the K Virtual Machine Simply known as KVM

Continued… 

The KVM is Sun's implementation of a JVM that fits the guidelines of the CLDC

J2ME Architecture

"Generic" J2ME architecture

MID Profile architecture