J2ME handnotes
##################3
Concept of J2ME
J2ME is a solution for mobile platform, for example mobile phone, pda,etc.
It defines the specification of application and development.
J2ME is one of the solutions for mobile, the others are Brew,sybian,etc.
The different between J2ME and others is it includes the JVM, you can write the code once,
and run anywhere.
####################
Structure of J2ME
Opitional Package
Profile
Configuration
Virtual Mechine
Operation System
################
Life Periods of J2ME Application
Several states:start, active, paused, destoryed
The methods causes the top states:startApp(),pauseApp(),destoryApp(boolean unconditional)
##############
A simple sample of J2ME Application
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Ssample extends MIDlet{
private Display display;
//构造函数
public Ssample(){
display = Display.getDisplay(this);
System.out.println("Constructor");
}
protected void startApp(){
System.out.println("startApp is called.");
Form f = new Form("HelloTest");
display.setCurrent(f);
}
protected void pauseApp(){
System.out.println("pauseApp is called.");
}
protected void destroyApp(boolean unconditional){
System.out.println("destroyApp is called.");
}
}
#######################
CLDC (connected limited devices configuration)
CLDC is one of the importent configurations on J2ME platform.
It defines the Virtual Machine and the mininum core class libraries.
The mininum core class libraries includes the following packages:
java.io
java.lang
java.util
javax.microedition.io
Notes:
CLDC only inclues the javax.microedition.io package, other packages,
such as javax.microedition.midlet, are definded by Profiles(MIDP).
So CLDC can't implement the functions, such as UI,Events,etc,
it's the job of Profiles.
--未完待续
##################3
Concept of J2ME
J2ME is a solution for mobile platform, for example mobile phone, pda,etc.
It defines the specification of application and development.
J2ME is one of the solutions for mobile, the others are Brew,sybian,etc.
The different between J2ME and others is it includes the JVM, you can write the code once,
and run anywhere.
####################
Structure of J2ME
Opitional Package
Profile
Configuration
Virtual Mechine
Operation System
################
Life Periods of J2ME Application
Several states:start, active, paused, destoryed
The methods causes the top states:startApp(),pauseApp(),destoryApp(boolean unconditional)
##############
A simple sample of J2ME Application
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Ssample extends MIDlet{
private Display display;
//构造函数
public Ssample(){
display = Display.getDisplay(this);
System.out.println("Constructor");
}
protected void startApp(){
System.out.println("startApp is called.");
Form f = new Form("HelloTest");
display.setCurrent(f);
}
protected void pauseApp(){
System.out.println("pauseApp is called.");
}
protected void destroyApp(boolean unconditional){
System.out.println("destroyApp is called.");
}
}
#######################
CLDC (connected limited devices configuration)
CLDC is one of the importent configurations on J2ME platform.
It defines the Virtual Machine and the mininum core class libraries.
The mininum core class libraries includes the following packages:
java.io
java.lang
java.util
javax.microedition.io
Notes:
CLDC only inclues the javax.microedition.io package, other packages,
such as javax.microedition.midlet, are definded by Profiles(MIDP).
So CLDC can't implement the functions, such as UI,Events,etc,
it's the job of Profiles.
--未完待续