+ All Categories
Home > Documents > J2ME for Palm

J2ME for Palm

Date post: 13-Jan-2016
Category:
Upload: lovie
View: 33 times
Download: 1 times
Share this document with a friend
Description:
J2ME for Palm. Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke. Outline. Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References. Introduction to Java. First commercial release was in 1995. - PowerPoint PPT Presentation
44
J2ME for Palm Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke
Transcript
Page 1: J2ME for Palm

J2ME for Palm

Speaker: Chen-Nien Tsai

Adviser: Kai-Wei Ke

Page 2: J2ME for Palm

2004/10/7 2

Outline

Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References

Page 3: J2ME for Palm

2004/10/7 3

Introduction to Java

First commercial release was in 1995. Before Java was called Java, it original name

was Oak, and it was developed as a part of the Green project at Sun.

Why Java: Cross platform Secure Robust Object oriented

Page 4: J2ME for Palm

2004/10/7 4

Java 2 Platform (1/2)

Java 2 Platform, Enterprise Edition (J2EE) Java 2 Platform, Standard Edition (J2SE) Java 2 Platform, Micro Edition (J2ME)

Page 5: J2ME for Palm

2004/10/7 5

Java 2 Platform (2/2)

Page 6: J2ME for Palm

2004/10/7 6

Java Compile and Runtime Environments

Page 7: J2ME for Palm

2004/10/7 7

Outline

Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References

Page 8: J2ME for Palm

2004/10/7 8

Java 2 Platform, Micro Edition

Basic Concepts Organization of the J2ME Platform

Configurations Profiles

Mobile Information Device Profile (MIDP) MIDlet

Page 9: J2ME for Palm

2004/10/7 9

Basic Concepts

J2ME platform adapts existing Java technology for handheld and embedded devices.

J2ME is as much about removing unnecessary parts of J2SE (or J2EE) as it is about defining new classes to address the stricter limitations of small devices.

Page 10: J2ME for Palm

2004/10/7 10

Organization of the J2ME Platform

Configuration Connected, Limited Device Configuration

(CLDC) Connected Device Configuration (CDC)

Profile Mobile Information Device Profile (MIDP) Personal Digital Assistant Profile (PDAP) Foundation Profile and others

Page 11: J2ME for Palm

2004/10/7 11

Configuration

A configuration defines the basic J2ME runtime environment. (virtual machine and a set of core classes)

Two configurations have been defined CLDC: KVM (Kilobytes VM), with some J2SE

capabilities removed. CDC: CVM (Compact VM), with full J2SE

capabilities.

Page 12: J2ME for Palm

2004/10/7 12

Profile

A profile extends a configuration, provides classes that are geared towards specific uses of devices and provide functionality missing from the base configuration. application life-cycle user interface network connections persistence mechanisms, etc.

Page 13: J2ME for Palm

2004/10/7 13

Mobile Information Device Profile

The Mobile Information Device Profile (MIDP) is the first and most mature J2ME profile.

The words "Java 2 Platform, Micro Edition" were synonymous with MIDP.

The Personal Digital Assistant Profile?

Page 14: J2ME for Palm

2004/10/7 14

MIDlet

A Java application that can run on mobile devices.

Two major files JAR (Java Archive file): contains Java classes, re

source files, and manifest file. JAD (Java Application Descriptor): contains a pre

defined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets.

Page 15: J2ME for Palm

2004/10/7 15

MIDlet suite

A grouping of MIDlets that can share resources at runtime.

Page 16: J2ME for Palm

2004/10/7 16

The MIDlet Life-Cycle

Paused The MIDlet instance has been constructed and is i

nactive. Active

The MIDlet is active. Destroyed

The MIDlet has been terminated and is ready for reclamation by the garbage collector.

Page 17: J2ME for Palm

2004/10/7 17

Developing and Testing a MIDlet

Page 18: J2ME for Palm

2004/10/7 18

Outline

Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References

Page 19: J2ME for Palm

2004/10/7 19

Create a J2ME Application for Palm OS

Software and tools you need J2SE SDK http://java.sun.com/j2se/ MIDP for Palm OS

http://java.sun.com/products/midp4palm/ J2ME Wireless Toolkit

http://java.sun.com/products/j2mewtoolkit/ Palm OS Simulator

http://www.palmos.com/dev/tools/simulator/

Page 20: J2ME for Palm

2004/10/7 20

MIDP for Palm OS

MIDP.prc in the PRCfiles directory, which is the application r

untime environment that supports MIDP for Palm OS.

Converter tool convert a MIDlet into a PRC (Palm Resource Cod

e) file.

Page 21: J2ME for Palm

2004/10/7 21

J2ME Wireless Toolkit

A development environment with a GUI. For compiling, packaging, and executing

MIDP applications. It includes the emulation environments as

well.

Page 22: J2ME for Palm

2004/10/7 22

Steps to create a J2ME application for Palm

Create a MIDlet Build a MIDlet Convert a MIDlet into a PRC (Palm Resource

Code) file Debugging and testing on palm simulator Run application on actual device (via HotSyn

c)

Page 23: J2ME for Palm

2004/10/7 23

Outline

Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References

Page 24: J2ME for Palm

2004/10/7 24

Demonstration

Wireless Toolkit Create, build, and run a MIDlet

Palm Simulator Convert a MIDlet into a PRC file Install MIDP for Palm OS Run MIDlet

Other examples

Page 25: J2ME for Palm

2004/10/7 25

Outline

Introduction to Java Java 2 Platform, Micro Edition Create a J2ME Application for Palm OS Demonstration Summary References

Page 26: J2ME for Palm

2004/10/7 26

Summary

Java 2 platform Concepts of J2ME Configuration and Profiles MIDP and MIDP for Palm The steps to create a J2ME application

Page 27: J2ME for Palm

2004/10/7 27

References (1/3)

『個人通訊服務軟體發展環境』研討會 李建誠 教授 元智大學通訊系

『 行動裝置之程式設計』 楊朝棟 副教授 東海大學資訊工程與科學系

Java2 platform http://java.sun.com/java2/whatis/index.html

A Brief History of the Green Project http://today.java.net/jag/old/green/

Page 28: J2ME for Palm

2004/10/7 28

References (2/3)

A Survey of J2ME Today http://developers.sun.com/techtopics/mobility/gets

tart/articles/survey/ MIDP for Palm OS 1.0: Developing Java Appl

ications for Palm OS Devices http://developers.sun.com/techtopics/mobility/mid

p/articles/palm/ Wireless Development Tutorial Part I

http://developers.sun.com/techtopics/mobility/midp/articles/wtoolkit/

Page 29: J2ME for Palm

2004/10/7 29

References (3/3)

Wireless Development Tutorial Part II http://developers.sun.com/techtopics/mobility/mid

p/articles/tutorial2/ J2SE 5.0 in a Nutshell

http://java.sun.com/developer/technicalArticles/releases/j2se15/

驚濤駭浪中誕生的 Java http://shoppingguide.ithome.com.tw/special/speci

al2004-09-22-001.html

Page 30: J2ME for Palm

2004/10/7 30

Appendix

Steps by steps Wireless Toolkit

A example code Build and run a MIDlet

Palm OS Simulator Install MIDP for Palm Convert a MIDlet into PRC file Run MIDlet

Page 31: J2ME for Palm

2004/10/7 31

Wireless Toolkit

Example – HelloMIDlet.javaimport javax.microedition.lcdui.*;import javax.microedition.midlet.*;

public class HelloMIDlet extends MIDlet implements CommandListener {

private Form mMainForm; public HelloMIDlet() { mMainForm = new Form("HelloMIDlet"); mMainForm.append(new StringItem(null, "Hello, MIDP!")); mMainForm.addCommand(new Command("Exit", Command.EXIT, 0)); mMainForm.setCommandListener(this); } public void startApp() { Display.getDisplay(this).setCurrent(mMainForm); } public void pauseApp() {} public void destroyApp(boolean unconditional) {} public void commandAction(Command c, Displayable s) { notifyDestroyed(); }}

Page 32: J2ME for Palm

2004/10/7 32

Wireless Toolkit

Launch “K Toolbar”

Page 33: J2ME for Palm

2004/10/7 33

Wireless Toolkit

Create a New Project (1/2)

File New Project…

Page 34: J2ME for Palm

2004/10/7 34

Wireless Toolkit

Create a New Project (2/2)

Use default setting

Page 35: J2ME for Palm

2004/10/7 35

Wireless Toolkit

Create a New Project (2/2) Copy the source file (HelloMIDlet.java) to C:\WTK21\apps\HelloSuit\src

Page 36: J2ME for Palm

2004/10/7 36

Wireless Toolkit

Build the project

Project Build

Page 37: J2ME for Palm

2004/10/7 37

Wireless Toolkit

Run the project

Project Run

Page 38: J2ME for Palm

2004/10/7 38

Palm OS Simulator

Launch the Simulator

Page 39: J2ME for Palm

2004/10/7 39

Palm OS Simulator

Install MIDP for Palm Drag the “MIDP.prc” and drop on simulator wi

ndow.

Page 40: J2ME for Palm

2004/10/7 40

Palm OS Simulator

Convert a MIDP into PRC file (1/4)

In WTK, Project Package Create Package

Page 41: J2ME for Palm

2004/10/7 41

Palm OS Simulator

Convert a MIDP into PRC file (2/4)

Execute “converter.bat”, which in the Converter directory.

note: you need set JAVA_PATH.

Page 42: J2ME for Palm

2004/10/7 42

Palm OS Simulator

Convert a MIDP into PRC file (3/4)

File Convert, then select the .jad file you just created by WTK. (in the bin directory)

Page 43: J2ME for Palm

2004/10/7 43

Palm OS Simulator

Convert a MIDP into PRC file (4/4)

If converting success, the PRC file will be created.

Page 44: J2ME for Palm

2004/10/7 44

Palm OS Simulator

Run the MIDlet Drag and drop the PRC file you just created.


Recommended