Understanding J2ME

xiaoxiao2021-03-06  17

What is J2ME?

Many people have been developing J2ME equivalent to mobile programs, in fact, this is a very wrong statement. Some people think that J2ME is a standard, a norm, which is also incorrect.

Sun defines J2ME (Java 2 Micro Edition, Java 2 Miniature) as "a highly optimized Java runtime environment with a wide range of consumer products. Since June 1999 declare on Javaone Developer Conference, J2ME entered the ranks of small equipment development. With Java's characteristics, the Java program developed by J2ME specification can run on a variety of different small devices.

J2ME is Sun Company consists of a framework defined by embedded development, a series of standard specifications. So J2ME is a protocol cluster, not a single specification.

J2ME is a very big concept, one of the following pictures can look at the scope of application of J2ME.

CDC and CLDC are simply referred to as the configuration of two types of devices of J2ME, namely:

l CDC (Connected DeviceL Configuration), the program running on this configuration is called J2ME Application and is explained on CVM.

l CLDC (Connected Limited Device Configuration, Connection Limit Device Configuration), program running on this configuration is called MIDlet, interpreted on KVM.

The CDC and CLDC can be understood as the definition of hardware, just like the PC and small machines, these devices provide a hardware environment running in the Java program.

There are two types of virtual machines in J2ME: CVM (C Virtual Machine, C Virtual Machine) and KVM (K Virtual Machine, K Virtual Machine). KVM and CVM can be seen as a Java virtual machine, a subset of JVM, which is functionally a reduction of JVM. The applicable range of these two types of virtual machines is not the same, simply, the function of CVM is more powerful than KVM functions.

Brief watch

J2ME uses Configuration (CDC or CLDC) and Javile Custom JRE (Java Runtime Environment, Java runtime environment). A complete JRE consists of configuration and profiles, the configuration determines the JVM (probably CVM or KVM) used, and the brief watch defines the functionality of the application by defining a specific class, a brief surface defines the device. The API collection provided.

If the CDC, CLDC understands that hardware configuration, PROFILE can understand the operating system on the hardware, which provides a set of functions that the program can call, that is, PROFILE defines the API function set of various functions. Of course, this metaphor is not exactly appropriate, because CVM and KVM act as a role that the Java program executes. Or may also understand the Profile as a developing package provided on a virtual machine, and different development kits provide different core functions. No matter how it is well understood, as long as it is easy to understand.

Here, you will also replenish a point: CDC specification and CLDC specifications also define basic API collections, which provide basic features of Java, such as java.io, java.lang, java.util, javax.microedition.IO It is defined in CDC and CLDC. However, these packages are the most basic functions of Java, and more equipment-oriented functional APIs must be provided by a brief watch.

Here are several common briefings:

l MIDP (Mobile Information Devices Profile): Defines the type of mobile information device and provides related API collections, and the function defined by MIDP is more user-oriented, and more advanced than CLDC. l IMP (INFORMATION DEVICE PROFILE, SMS): Defines a network connection, but the display mode is a single device, such as alarm.

l Foundation Profile: Provides a standard class library that can be provided in addition to the user interface.

l Personal profile: For those resources, the network access is high, the device based on the AWT graphical interface, such as web-TV, car navigation system, etc.

In addition, there are other types of profiles, but the four briefings above is recommended by Sun, and is an open brief watch. For example, the previous kjava is a brief watch similar to MIDP.

These specifications are the basic specification in J2ME, for example, CLDC devices must support CLDC specifications, while choosing to support a brief mesh specification, may be MIDP or other profiles. For CDC devices, CDC specifications must also be supported, and simultaneous choice of supporting a brief mesh specification may be FP, or PP may also be PP.

转载请注明原文地址:https://www.9cbs.com/read-41031.html

New Post(0)