Basics Components of CLDC:
CLDC is implemented most of the mobile platforms and it contains various components of the java platform. CLDC consists of these components are given below.
a)Kilobyte Virtual Machine (KVM)
c)Java Programming language
a. Kilobyte Virtual machine (KVM):
the KVM represents the virtual machine for small devices that implemented CLDC. The KVM is also compliant with JVM, which is used in J2SE edition but has limited features as compared to JVM.
Kilobyte Virtual machine(kvm):
Does not support JNI
Does not support thread groups. Thread operations, such as starting and stopping a thread, can only be applied to individual object
Does not support reflection features.
Performs class file verification in two steps, preverifiction and in-device verification.
Java Virtual machine
Supports JNI Includes features to reduce the cost of implementation of virtual machine
Support thread group
Support reflection features.
Perform class verification only once, during compilation of java classes.
b. CLDC Library:
The CLDC library have a minimum useful set of APIs that supports application development and profile definition. CLDC library provide upward compatibility of application to other java platform editions, such as J2SE and J2EE. Upward compatibility is difficult to achieve because of inter-dependencies between the J2SE and J2EE library. To support upward compatibility of its libraries, CLDC segregates its library into two categories that represent the dependent and interdependent library.
The two main categories of CLDC libraries are as follows:
Class that are interdependent on standard J2SE libraries, such as java.lang.*, java.util .*, and java.io.*: These classes are upward compatible with J2SE and J2EE.
Classes that are independent of other java libraries but are specific to J2ME, such as javax.microedition.io.*:
The java language used in CLDC does not support most of java language features available in the J2SE edition. Below lists the main difference between the java language functionality in CLDC and J2SE.
Does not support finalize() method
Support only two error handling classes, Java.lang.VirtualMachineError and Java.lang.OutOfMemoryError.
Java J2SE Features
Support the finalize() method
Support other error handling classes, such as
java.lang.Error and java.lang.Exception.
Version of CLDC
There are two versions of CLDC, CLDC 1.0 and CLDC 1.1. The CLDC1.0 was upgraded to CLDC1.1 by adding new &more features and specification to it. Below table compares the features of CLDC1.0 and CLDC1.1.
CLDC 1.0 Features
Floating point operations are not supported
Does not resolve all error-handling requirements
Does not support thread objects
Does not support all features of CLDC libraries
Requires minimum 160 KB
CLDC 1.1 Features
CLDC Support all floating point operations including all floating point byte codes, Float and Double class and all floating point values.
Resolve all error-handling requirements, and includes an additional error-handling class, NoClassDefFoundError.
Introduce a new method, Thread.getName(), Which helps identify the name of thread. Name of thread object in CLDC 1.1 are similar to the name of thread object in J2SE.
Requires minimum 192 KB and to support the floating-point operations higher memory is required.