1 / 8

J2ME -- Introduction

J2ME -- Introduction. Introduction / Overview Java 2 Micro Edition CLDC MIDP Examples. 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)

misu
Download Presentation

J2ME -- Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. J2ME -- Introduction Introduction / Overview Java 2 Micro Edition CLDC MIDP Examples

  2. 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, OutputStream DataInputStream, DataOutputStream ByteArrayInputStream, ByteArrayOutputStream InputStreamReader, OutputStreamReader PrintStream Reader Writer • exception, error classes etc

  3. J2ME -- CLDC • The Connected Limited Device Configuration (CLDC) • Package java.lang contains • interface Runnable • classes Boolean Byte Character Class Integer Long Math Object Runtime Short String StringBuffer System Thread Throwable • Package java.util contains • interface Enumeration • classes Calendar Data Hashtable Random Stack Timer TimerTask TimeZone 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

  4. 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 Choice CommandListener ItemListener • classes Alert AlertType Canvas ChoiceGroup Command DataField Display Displayable Font Form Gauge Graphics Image ImageItem Item List Screen ScreenItem TextBox TextField Ticker

  5. J2ME -- MIDP • The Mobile Information Device Profile (ctd) • Package javax.microedition.io contains support for networking - • interfaces Connection ContentConnection Datagram DatagramConnection HttpConnection InputConnection OutputConnection StreamConnection StreamConnectionNotifier • class Connector

  6. J2ME -- MIDP • The Mobile Information Device Profile • Package javax.microedition.rms contains support for local storage - • interfaces RecordComparitor RecordEnumeration RecordFilter RecordListener • class RecordStore • 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

  7. Graphics in a MIDlet <<interface>>javax.microediiton.lcdui.Displayable <<abstract>> Canvas <<abstract>> Screen (high-level) (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 • Screen is “high level” • a container of laid-out components

  8. 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

More Related