260 likes | 504 Views
JVM Introduction & Porting. Speaker: Ching-Wen Lin Date:2007.02.14. Outline. JVM Introduction Java 2 Edition J2ME Introduction JVM Porting CLDC Porting MIDP Porting MIDlet Design Introduction Design How to Use. How can do ?. Why Use Java ? Write once, run anywhere
E N D
JVM Introduction & Porting Speaker: Ching-Wen Lin Date:2007.02.14
Outline • JVM Introduction • Java 2 Edition • J2ME Introduction • JVM Porting • CLDC Porting • MIDP Porting • MIDlet Design • Introduction • Design • How to Use
How can do ? Why Use Java ? Write once, run anywhere Provide more services Multimedia Game Other Application Introduction (1/2)
The Trend of Java Mobile Phone Introduction (2/2) 資料來源:資策會MIC~全球行動通訊軟體市場發展驅勢 2006.08.18
Java 2 Edition (1/2) • Java2 is divided in three platform: • J2EE (Java2 Platform Enterprise Edition) • Business applications, server-side. • J2SE (Java2 Platform Standard Edition) • General applications, client-side. • J2ME (Java2 Platform Micro Edition) • Small devices such as mobile phone, PDA, car navigation. • JAVA CARD • Multiple applications can be deployed on a single card.
Java 2 , Micro Edition Java 2 Edition (2/2)
According different devices to define function. For Example : Screen size , Input method , Paint function …etc. According different CPU , network capability or power …etc. to define classes. For Example : WLAN and LAN use different driver. J2ME Structure • J2ME Structure
MIDP (Mobile Information Device Profile) Define function for mobile phone(Ex: Message , Voice) Build on CLDC MIDP Version MIDP 1.0 The First MIDP version LCD at least 96*54 pixel minimum memory 32KB MIDP 2.0 The popular version LCD at least 96*54 pixel minimum memory 256KB Profile
Java Community Process(JCP) http://jcp.org/ Java Specification Request (JSR) MIDP 1.0(JSR 37) MIDP 2.0 (JSR 118) CLDC 1.0(JSR 30) CLDC 1.1(JSR 65) The Optional Package JSR-82 Java API for Bluetooth JSR-135 Mobile Media API JSR-179 Location API for J2ME JSR-184 Mobile 3D Graphic API Optional Package
Hardware CPU GDM 5105, GCT Memory Flash Memory, 8Mb Mobile SDRAM, 32Mb LCD 176*226 pixel Software OS ucLinux GDI Microwindow Porting Object CLDC 1.0 MIDP 2.0 P204 Spec.
Download Open-Source: CLDC http://java.sun.com/products/cldc/ MIDP http://java.sun.com/products/midp/ J2ME Element: C Native Methods Connect with low-level Java Function Code How to Porting ?
Configuration K Virtual Machine (KVM) Class , API The latest version CLDC 1.1 Add Float Point Porting Initializations Finalizations Heap’s Allocate and Free Fatal error reporting Event handling Time Process Configuration (CLDC Porting)
Profile(MIDP Porting) • Low-level Graphics API • High-level Graphics API
Example P204
MIDlet Design (1/2) • MIDlet (Mobile Information Device let) • The basic unit of Java Mobile Phone Program. • MIDlet Suite • Several MIDlet applications can pack in one JAR file , called MIDlet suite. • Including classes files and relevant resources (Ex: graph, sound …etc.) • JAM (Java Application Manager) • Java support to manger MIDlet Suite.
MIDlet Design (2/2) • JAD (Text File) • Describe MIDlet Suite’s properties. • JAR(ZIP Compressed File) • MIDlet and other class files • Resource : Image , text , sound … etc. • Manifest.mf: Descript MIDlet basic data.
MIDlet Source Code import javax.microedition.midlet.*; public class HelloMIDlet extends MIDlet { public HelloMIDlet() { // Structure } public void startApp() { // Start } public void pauseApp() { // Pause } public void destroyApp(l) { } } MIDlet Life Cycle MIDP Code
How to Use ? • OTA (Over The Air) • Through wireless to download MIDlet. • No OTA • Transmission Line • IR • Bluetooth • MMS • E-mail
P204 Support : Basic Operation Text Image: PNG,JPG,GIF…etc Provide Double Buffer Sound:MIDI JVM Demo