Search This Blog

Thursday, 6 July 2023

Java Language for J2ME

0 comments
Sun Microsystems grouped features of Java into three editions, each having a Software Development Kit (SDK). The original edition of Java, called the Java 2 Standard Edition (J2SE), consists of application programming interfaces (APIs) needed to build a Java Application or Applet. 

Java 2 Standard Edition (J2SE):

Java is an evolving programming language that began with the release of the Java Development Kit (JDK). During this evolutionary process, the Java development team included more interfaces and libraries as programmers demanded new APIs. These new features were called extensions—APIs that were add-ons to the JDK. Sun Microsystems incorporated these extensions into a new Java development kit called J2SE

Java 2 Enterprise Edition (J2EE):

An increased emphasis was placed on server-side programming and on development of vendor-independent APIs to access server-side systems. Sun responded by creating the Java Community Process Program that invited corporate users, vendors, and technologists to develop a standard for enterprise Java APIs. The Java Community Process Program effort resulted in J2EE.

J2EE is a combination of several technologies that offer a cohesiveness to bond together server-side systems and services to produce an industrial-strength scalable environment within which web-centric applications can thrive.  J2ME is a reduced version of the Java API and Java Virtual Machine that is designed to operate within the sparse resources available in the new breed of embedded computers called small computing devices.

Here is a video presentation on J2ME and its architecture for MAD.

Java 2 Micro Edition (J2ME):

The Java 2 Micro Edition (J2ME) contains the API used to create applications for small computing devices, including wireless Java applications. And the Java 2 Enterprise Edition (J2EE), an embellished version of the J2SE to accommodate n-tier architecture, has the API to build applications for multi-tier architecture.

CDC implements the full J2SE available, but CLDC implements a stripped-down J2SE because of the limited resources in small computing devices.  The following are some of the features available in J2SE but not part of J2ME:
  1. Performing Floating Point Arithmetic
  2. Supporting finalize() method
  3. Handling Exceptions of All types
Floating point math requires special processing hardware to perform floating-point calculations.  However, most small computing devices lack such hardware and therefore are unable to process floating-point calculations.

Support for finalize() methodThe finalize() method in J2SE is automatically called before an instance of a class terminates and typically contains statements that free previously allocated resources. However, resources in a small computing device are too scarce to process the finalize() method.

Reduced number of error-handling exceptions:  Exception handling drains system resources, which are precious in a small computing device and therefore the primary reason for trimming the number of error-handling exceptions.  Table 3-3 lists error-handling exceptions available in J2ME.
 



Changes Made in the JVM of J2ME:
  • JVM for small computing devices requires a custom class loader that is supplied by the device manufacturer and cannot be replaced or modified.
  • Lack of  ThreadGroup class: We cannot group threads. All threads are handled at the object level.
  • We cannot call other programming languages’ methods and APIs, primarily because of the memory requirements to execute such calls. 
  • Two other features of J2SE that are missing from J2ME are weak references and the Reflection classes.
Test your knowledge on the fundamentals of J2ME and Mobile Application Development

Leave a Reply