Author: Natsuhiko end
I have always wanted to write something to learn J2ME to make a summary. Since last time the notebook inexplicably lost after the bedroom, I have never written J2ME's study notes. I finally got a courage to make a pen, and I also prepared to learn J2ME brothers. The sisters play a piece of jade, huh, huen, hopes that everyone is disappointing.
Let's start from the most basic beginning ~
J2ME's full name is Java2 Platform Micro Edition, and its technical architecture is as follows
Optional Package Profile Configuration
Optional package is a vendor selective implementation. Profile is a high-level API set for special hardware regulations. Configuration is the role of defining hardware functions and low-level APIs.
Start from the bottom of the CONFIGURATION, it is a J2ME specifying the specification of the embedded device to execute the Java program. J2ME is limited, and the embedded device of the calculation function is called Connected Limited Device. If these devices can be implemented, if they can perform Java The program must be observed, and these specifications are defined in the Connected Limited Device Configuration, referred to as CLDC, similar to a connected, resource relatively unlimited device, is called Connected Device, and there is also a CDC specification. The phone we usually use is a CONNECTED LIMITED DEVICE. The mobile phone that supports J2ME must support the support of the CLDC specification. In the current point of view, there are 1.0 and 1.1, the biggest difference is the latter support floating point operation, and the former does not support, CDC 1.0 and CDC1.1 core class libraries (java.lang. *, Java .io. *, java.util. *) and J2se have almost no difference. CLDC1.0 is different, and CLDC1.1 is relatively relatively enhanced with CLDC1.0 function. The minimum amount of memory is also raised from 160K to 192K. The support extension library added by CLDC is javax.microedition.IO. *, Etc.
View CLDC Class Library Documents
You can get the following information, in order to make it easy for everyone, I have made a few big categories:
System class:
Java.lang.object
Java.lang.class
Java.lang.Runtime
Java.lang.system
Java.lang.thread
Java.lang.Runnable (interface)
Java.lang.string
Java.lang.StringBuffer
Java.lang.Throwable
Data Type Category:
Java.lang.Boolean
Java.lang.byte
Java.lang.short
Java.lang.integer
Java.lang.long
Java.lang.float (start support from version 1.1)
Java.lang.double (start support from version 1.1)
Java.lang.Character
Collection container:
Java.util.Vector
Java.util.stack
Java.util.hashable
Java.util.enumeration (interface)
Input / output class:
Java.io.inputStream
Java.io.outputstream
Java.io.byteArrayInputStream
Java.io.byteArrayoutputstream
Java.io.DataInput (interface)
Java.io.Dataoutput (interface)
Java.io.DataOutputSteam
Java.io.DataInputStream
Java.io.reader
Java.io.writer
Java.io.inputsteamReader
Java.io.OutputStreamReader
Java.io.printStream
Calendar and time class:
Java.util.calendar
Java.util.date
Java.util.timezone
Other additional classes:
Java.util.random
Java.lang.math
Error class:
Java.lang.Error
Java.lang.noclassdefounderror (support from version 1.1)
Java.lang.OutofMemoryError
Java.lang.virtualMachineError
Abnormal class:
Java.lang.exception
Java.lang.arithMeticexception
Java.lang.ArrayIndexOutofboundsexception
Java.lang.ArrayStoreException
Java.lang.classcastexception
Java.lang.classNotFoundException
Java.lang.illegaCCssexception
Java.lang.illegalargumentException
Java.lang.illegalmonitorStateException
Java.lang.illegalthreadStateException
Java.lang.indexOutofboundSexception
Java.lang.instantiationException
Java.lang.InterruptedException
Java.lang.negativeAraysizeException
Java.lang.nullpointerException
Java.lang.RuntimeException
Java.lang.NumberFormATexception
Java.lang.securityException
Java.lang.StringIndexOutofboundsexception
Java.util.emptyStackException
Java.util.emptynosuchelementexception
Java.io.eofexception
Java.io.InterruptedioException
Java.io.ioException
java.io.unsupportedEncodingexception
Java.io.utfdataFormatexception
Weak reference: (starting from version 1.1)
Java.lang.ref.reference
Java.lang.ref.weakreference
The following is a CLDC1.1 extended class library:
Javax.microedition.midlet. *
Javax.microedition.lcdui. *
Javax.microedition..rms. *
Javax.microedition..io. *
Javax.microedition.lcdui.game. *
Javax.microedition.pki. *
Javax.microedition..media. *
Javax.microedition.media.control. *
Let's say Profile, since Profile is built on the Configuration, its specification is naturally not lower than the Configuration, and the profile we usually has Mobile Information DEVICE PROFILE (MIDP), for mobile phones and Pager, and other mobile devices. There is also a common Profile, Information Module Profile, is designed for mobile devices without screens. At present, MIDP, the highest specification is 2.0, and the hardware requirements are:
Memory: 256KB non-volatile memory can be used by MIDP components, 8KB non-volatile memory works creates persistence data, 128KB volatile memory can be used in virtual machine runtime environments.
Display: Screen size 96 * 54, display depth: 1 bit, pixel shape (aspect ratio): 1: 1.
Enter: One-hand keyboard or hands keyboard or touch screen.
Network: two-way, wireless, can be intermittent, limited bandwidth.
Sound: Play different tone capabilities, can be obtained through software algorithms through a dedicated hardware.
In the J2ME specification, manufacturers also define packages that manufacturers can choose to implement, that is Optional Packages, usually different products from different manufacturers will have some different functions, then manufacturers can use the Optioanl Packages specification to achieve specific functionality of certain products. Corresponding API.
Then we usually say J2ME development, most of them are all MIDP programming, then let's first see the explanation of several nouns:
MIDlet: A basic unit of executable application mobile phone program.
MIDLET Suite: Many MIDLETs constructed are generally called MIDP Application (MIDP applications).
The relationship between MIDlet and MIDlet Suite is shown below
JAR file (jar file, .jar file)
It is actually wrapped in the file of MIDlet Suite, which belongs to the ZIP compression format.
JAD file (Descriptor file, .jad file)
A text file used to describe the basic information of the MIDlet Suite, it is an external file (not existing inside the JAR file, an independent file).
The only relationship is as shown below:
Finally, you should introduce the application manager (Java Application Manager), it is important, it is responsible for the execution of the MIDlet and its lifecycle. It is a native program used to perform J2ME.