At the beginning, we thought that various concepts, such as the inheritance of java-based classes, were certainly different. It is boring. To
I had a headache when talking about transaction processing before I learned java. Haha.
Haha, I started to study the transaction processing of the MIDlet. In fact, I have never written an Applet before, but the Servlet is much more written,
After all, servlet is also important in MVC. Any servlet must inherit javax. servlet. http. HttpServle
T class, in fact, as a MIDlet is also a concept, all MIDlet must inherit javax. microedition. midlet. MID
Let. To put it bluntly, it inherits the three methods startApp (), pauseApp (), and destoryApp.
After a MIDlet starts running successfully, its lifecycle starts. This lifecycle is completely controlled by JPM. MIDlet
A MIDletStateChangeException is thrown when the status change occurs unexpectedly.
In the entire MIDP specification, transaction processing is divided into high-level transaction processing and low-level transaction processing. Low-level Transaction Processing Based on Different handheld devices
Different class libraries are supported, while Advanced Transaction Processing does not. That is to say, if the MIDlet we do wants to be on different machines
We can only use methods in Advanced Transaction processing instead of calling methods in low-level transaction processing.
In the entire MIDP, transaction processing is formed by a combination of transaction <-> processing methods.
All the components with the display capability of MIDP inherit from the Displayable abstract class, And it derives the Screen
And Canvas (for low-level transaction processing ). There are two interfaces for middle-level Transaction Processing in MIDP: CommandListener and Ite.
MStateListener. The CommandListener interface is often used with the Command class in javax. microedition. lcdui. Yes
Take the following example:
/**
* @ Author You Li
*
* CopyRight (C) 2005
*/
Import javax. microedition. midlet .*;
Import javax. microedition. lcdui .*;
Public class HLEventMIDlet extends MIDlet implements CommandListener {
Private Command exitCommand;
Private Command info1Command;
Private Command info2Command;
Private Display display;
Public HLEventMIDlet (){
Display = Display. getDisplay (this );
ExitCommand = new Command ("exit", Command. SCREEN, 1); // The smaller the number, the higher the priority.
Higher
Info1Command = new Command ("menu 1", Command. SCREEN, 2 );
Info2Command = new Command ("menu 2", Command. SCREEN, 2 );