Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java 2 Micro Edition The Connected, Limited Device Configuration.

Similar presentations


Presentation on theme: "Java 2 Micro Edition The Connected, Limited Device Configuration."— Presentation transcript:

1 Java 2 Micro Edition The Connected, Limited Device Configuration

2 / 2 of Chapter Objectives CLDC Specification CLDC Scope Limitations of Java Language Support in CLDC The Core API CLDC Packages Common CLDC Packages Using

3 / 3 of CLDC CLDC is the Connected, Limited Device Configuration. The first goal is to define a specification for a JVM called the KVM (K for kilo) and the second is to define a set of Java classes (libraries). Hardware Requirements:  128 kilobytes of nonvolatile memory for running the JVM and the CLDC libraries.  32 kilobytes of volatile memory available during application runtime for allocation of objects.  With an intermittent network connection Software Requirements: The host OS must be capable of running the JVM and managing Java applications on the device, including:  Selecting and launching of applications  The ability to remove Java applications from the device The implementation of these features is not specified in the CLDC, and thus is device-dependent and left to the manufacturer.

4 / 4 of CLDC Scope

5 / 5 of Features Tossed Overboard Because the KVM has to be so much smaller than a J2SE JVM, some features are missing: No floating point support No user classloaders No finalization No reflection  This implies no serialization, RMI, or JINI No native methods  Except those that are compiled into the JVM

6 / 6 of Core Packages CLDC Packages  java.io Standard Java IO classes and packages; subset of the J2SE package  java.util VM classes and interfaces; subset of the J2SE package  java.util Standard utility classes and interfaces; subset of the J2SE package  javax.microedition.io CLDC generic connection framework classes and interfaces

7 / 7 of CLDC packages java.util package This package has the classes that are fundamental to the Java language. These classes define the data types, basic exceptions, and so on. Many classes that are not required in J2ME are absent. java.io package This package for providing data input and output through data streams. Because of the limited input/output capabilities of the mobile devices, this package provides limited functionality as compared to the java.io package in Java Standard Edition. java.util package This package contains the utility classes for such things as generating random numbers, creating time zone objects, implementing growable array of objects, enumeration, and so on.

8 / 8 of Commonly Used Packages java.util.object java.util.Boolean java.util.Byte java.util.Integer java.util.Long java.util.Short java.util.String java.util.StringBuffer java.util.Runtime java.util.System java.util.Thread java.util.Math java.util.Calendar java.util.Character java.util.Class

9 / 9 of Commonly Used Packages java.util.Date java.util.Random java.util.Hashtable java.util.Long java.util.Timezone java.util.Vector java.util.Stack java.io.InputStream java.io.ByteArrayInputStream java.io.DataInputStream java.io.OutputStream java.io.ByteArrayOutputStream java.io.DataOutputStream java.io.PrintStream java.io.Reader java.io.InputStreamReader java.io.Writer java.io.OutputStreamWriter

10 / 10 of Multithreading Creating and starting threads is the same as J2SE, using java.lang.Thread The Runnable interface is also present Unsupported:  Thread naming  Daemon threads  suspend(), resume(), and stop()  interrupt()

11 / 11 of String and StringBuffer These classes are much the same as in J2SE Note that you will probably have to be more careful about the number of Strings you’re creating you’re creating  It’s easy to use Strings carelessly  The constraints of a small device will highlight inefficient algorithms

12 / 12 of java.lang.Math In J2SE, Math contains many static methods, mainly for trigonometry MIDP has no floating point support, so only a handful of integer-based methods remain See the API documentation

13 / 13 of Runtime Provides access to the KVM See the API documentation

14 / 14 of System Provides system-wide services There’s no There’s no System.in See the API documentation

15 / 15 of Streams in java.io MIDP’s java.io is a lot smaller than J2SE’s java.io There are three reasons for the differences:  MIDP has no local file system  MIDP has no object serialization  MIDP doesn’t include most of the utility streams that are present in J2SE Reader and Writer are available, but don’t count on a lot of available encoding schemes

16 / 16 of Collections MIDP reverts back to the JDK 1.0 collections  Vector  Hashtable Usage is much the same as it was in JDK 1.0 and JDK 1.1 Note that new Collections API methods are not available  For example, Vector has the old addElement() method but not the Collections API add() method

17 / 17 of Timers MIDP includes java.util.Timer and java.util.TimerTask  These were introduced into J2SE in the 1.3 SDK  The APIs are almost exactly the same as in J2SE See the API documentation

18 / 18 of Telling Time java.util.Date represents a point in time java.util.Calendar translates between points in time and calendar fields javax.microedition.lcdui.DateField is for the display and editing of points in time  We’ll cover this later java.util.TimeZone represents a time zone and is used by the Calendar and DateField classes

19 / 19 of Lab

20 / 20 of Summary CLDC is the Connected, Limited Device Configuration Because the KVM has to be so much smaller than a J2SE JVM, some features are missing CLDC provides core packages


Download ppt "Java 2 Micro Edition The Connected, Limited Device Configuration."

Similar presentations


Ads by Google