តាមញ៉ុមអានអីបុក J2ME (Java 2Platform, Micro Edition)
J2ME is Sun’s version of Java aimed at machines with limited hardware resources such as PDAs, cell phones, and other consumer electronic and embedded devices. J2ME is aimed at machines with as little as 128KB of RAM and with processors a lot less powerful than those used on typical desktop and server machines. J2ME actually consists of a set of profiles. Each profile is defined for a particular type of device — cell phones, PDAs, microwave ovens, etc. — and consists of a minimum set of class libraries required for the particular type of device and a specification of a Java virtual machine required to support the device. The virtual machine specified in any profile is not necessarily the same as the virtual machine used in Java 2 Standard Edition (J2SE) and Java 2 Enterprise Edition (J2EE). You’ll see that the profile we’ll use to develop a Palm OS device application is a subset of the Java Virtual Machine you already know.
To date, Sun has released the following profiles:
- The Foundation Profile — A profile for next generation consumer electronic devices
- The Mobile Information Device Profile (MIDP) — A profile for mobile information devices, such as cellular phones and two-way pagers, and PDAs
A profile in itself does not do anything; it just defines the specification. Profiles are implemented with a configuration. You can think of a configuration as an implementation of a J2ME profile for a particular type of device such as a PDA. Some of the configurations currently available are
| Connected Device Configuration (CDC) | An implementation of the Foundation Profile for next-generation, consumer electronic and embedded devices |
| Connected Limited Device Configuration (CLDC) | An implementation of MIDP for small, resource-constrained devices such as Palm OS devices. |
Since each profile defines a different set of Java class libraries, you cannot take a Java application written for one profile and run it on a machine that supports another profile. Likewise, you cannot take an application written for Java 2 Standard Edition (J2SE) or Java 2 Enterprise Edition (J2EE) and run it on a machine that supports J2ME. You can only use the Java classes provide in the Java class library included in your target device’s profile. Restricting yourself from using all of the Java classes you’ve grown to rely on is one of the hardest parts of writing Java applications for small devices.
The rest of this article focuses on using the MIDP profile and CLDC configuration to create an application for a PDA running the Palm operating system.
បើយើងចាប់ផ្ដើមសរសេរយើងគិតទៅលើ
- Configuration (CLDC or CDC)
- Profile (បើ CLDC យក profile MIDP, បើ CDC យក profile Foundation)
អត្តបទយោង:http://onjava.com/pub/a/onjava/2001/03/08/J2ME.html
