From today on, I think I will not involve real development for a long time. This period of time is mainly focused on basic learning.
. Oh, no. How can I run it? But it is mainly because you don't have to rush to give your brother something for the moment, so you want to study it well. No
I will certainly write some code. After all, you can learn faster by writing more code.
Haha, the journey of Mobile Phone development has been started step by step. I don't know if I can finish learning this part because the company is under a lot of pressure.
Large. There is basically no rest at ordinary times, and there is still a bunch of things to do on weekends. So it is also a bitter aspect. Haha. Try your best. I
Direct web application is not a solution. You may need to learn more. After all, handheld devices are a future trend.
I used sun's official MIDP instance when I was studying. You can go down on your own. I chose MIDP_2.0 reference source code.
To write a MIDlet, perform the following steps on the actual device or simulator:
1. Write Program code
2. Compile
3. Pre-approval (Preverify) is very important because J2SE support is installed on many types of PCs, but the actual J2SE does not support
Hold.
4. Write Descriptive documents
5. Merge JAR files
6. Test troubleshooting
7. Run on the simulator or physical machine.
OK
Let me start to write a simple example, which completes the final seven steps from the beginning of code writing. (This example is based on MIDP_2.
Some interfaces have been defined in "0", so I put this program under the MIDP root directory I extracted: f: midp .)
Step 1: write the code:
Import javax. microedition. midlet .*;
Import javax. microedition. lcdui .*;
Public class HelloMIDlet extends MIDlet implements CommandListener {
Private Command exitCommand;
Private Display display;
Public HelloMIDlet (){
Display = Display. getDisplay (this );
ExitCommand = new Command ("Exit", Command. SCREEN, 2 );
}
Public void startApp (){
TextBox t = new TextBox ("Hello MIDlet", "Test string", 256, 0 );
T. addCommand (exitCommand );
T. setCommandListener (this );
Display. setCurrent (t );
}
Public void pauseApp (){}
Public void destroyApp (boolean unconditional ){}
Public void commandAction (Command c, Displayable s ){
If (c = exitCommand ){
DestroyApp (false );