J2ME - Introduction: Advanced Applications Development in Java

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 8

Advanced Applications Development in Java

J2ME -- Introduction

Introduction / Overview Java 2 Micro Edition

CLDC MIDP

Examples

Michael Brockway

Java 2 Micro Edition -- CLDC


A version of the Java platform which supports small devices -- hand-helds, cell phones, pagers, embedded systems, ... The Connected Limited Device Configuration (CLDC)

a set of APIs for applications for devices with limited screens size, memory, power, bandwidth. Contains

the kilobyte virtual machine (KVM) packages java.io, java.lang, java.util small subsets of the corresponding J2SE packages

See java.sun.com/j2me/docs/pdf/cldcapi.pdf for details Package java.io contains


interfaces DataInput, DataOutput classes InputStream, DataInputStream, ByteArrayInputStream, InputStreamReader, PrintStream Reader exception, error classes etc

OutputStream DataOutputStream ByteArrayOutputStream OutputStreamReader Writer

J2ME -- CLDC

The Connected Limited Device Configuration (CLDC)

Package java.lang contains


interface Runnable classes Boolean Integer Runtime System interface Enumeration classes Calendar Random TimerTask

Byte Long Short Thread

Character Math String Throwable

Class Object StringBuffer

Package java.util contains


Data Stack TimeZone

Hashtable Timer Vector

CLDC version 1.0 contained no floating point types, no serializable objects no thread groups no JNI CLDC 1.1 which appeared in March 2004 contains more features,

including floating point arithmetic support


3

J2ME -- MIDP

The Mobile Information Device Profile


APIs for programming mobile devices -- phones, Palm Pilots, ... Application software in MIDlets Package javax.microedition.lcdui contains GUI classes for devices with LCD screens

interfaces classes

Choice Alert Command Font Image Screen Ticker

CommandListener AlertType DataField Form ImageItem ScreenItem Canvas Display Gauge Item TextBox

ItemListener ChoiceGroup Displayable Graphics List TextField

J2ME -- MIDP

The Mobile Information Device Profile (ctd)

Package javax.microedition.io contains support for networking

interfaces

Connection Datagram HttpConnection OutputConnection StreamConnectionNotifier Connector

ContentConnection DatagramConnection InputConnection StreamConnection

class

J2ME -- MIDP

The Mobile Information Device Profile

Package javax.microedition.rms contains support for local storage

interfaces

class

RecordComparitor RecordFilter RecordStore

RecordEnumeration RecordListener

Package javax.microedition.midlet contains the MIDlet class The minimum hardware for a MIDlet:

at least 96 X 54 pixels monochrome display a two-way wireless network an input device 128 kb for CLDC & MIDP classes at least 32 kb for the KVM

Graphics in a MIDlet

<<interface>>javax.microediiton.lcdui.Displayable

<<abstract>>

<<abstract>>

Screen

(high-level)

Canvas

(low-level) Alert

TextBox

List

Form

Canvas is low leve1

not a container, but we can override its paint method to use Graphics draw methods
a container of laid-out components
7

Screen is high level

Practicalities

Download the J2ME Wireless Toolkit from http://java.sun.com/products/j2mewtoolkit/index.html


Install in Windows or Linux Documentation accompanies the software

Look at the tutorial material in http://developers.sun.com/techtopics/mobility/learn/

Especially MIDlet Life Cycle and Getting Started with MIDP.

Exercises

Make a MIDlet which will display a multiplication table when an integer between 1 and 12 is input. Make a MIDlet which will do simple (+, -, X, /) calculations on two input numbers

You might also like