J2ME (Java 2 Micro Edition) is now a mainstream, universal mobile phone program Development technology, in the actual development of the extensive use of the process. and mobile phone program development as a new area of software development, the demand for talent and products is far from being satisfied, so mobile phone program development technology has become the hottest, but also the development of a bright future technology. This article introduces the first link of J2ME technology development--the installation of development environment and the practical use.
J2ME Technology as a general technology, targeted at the main areas of consumer electronics, including set-top boxes, car equipment, videophone, mobile phones and other equipment, the following only describes the J2ME technology for mobile phone application development tools used in the type.
In the actual environment, mobile phone models and a wide range of performance and characteristics of each cell are different, and the mainstream of mobile phone manufacturers will be in the standard J2ME technology based on some of their own unique functions to facilitate the development of programmers, Therefore, the development of J2ME mobile Phone program development environment is divided into the following two major categories:
1. Common Development Tools
Common development tools can develop programs that run on all mobile phones that support J2ME technology. In the actual development process is mainly used to develop and mobile phone screen size unrelated to the program and no dedicated development tools for mobile phone programs.
General development tools are mainly sun company J2ME Wireless Toolkit, now the latest version is 2.3beta, generally using the tool's stable version 2.2, download the address as follows:
2, special development tools (manufacturer development tools)
Special-purpose development tools refer to the specialized development packages developed by each handset manufacturer for its own model cell phone. Basically, the mainstream handset manufacturers have their own dedicated development tools to facilitate programmers to develop dedicated mobile phone programs, and provide their own model of the simulator, to facilitate the programmer in the computer for practical simulation.
Proprietary development tools are generally available to developers for free, but they generally need to be registered when downloading.
The special development tool according to the handset model mainly has the following several:
Nokia Nokia Developer ' s Suite for J2ME
Nokia series of mobile phone development tools, the latest version is currently 3.0. Nokia mobile phone in the domestic market share is relatively high, and for J2ME development support is also relatively good, so the current J2ME development in the use of relatively high frequency of manufacturers development tools.
The following is an example of Sun's J2ME Wireless Toolkit 2.2, which describes the installation and use of the J2ME development environment. Because there are more users of Windows operating systems, the following is an introduction to installation and use on Windows platforms.
J2ME Wireless Toolkit 2.2 Installation process is relatively simple, the following two aspects to introduce:
Double-click j2me_wireless_toolkit-2_2- Ml-windows.exe, start the installer, during the installation process will automatically find the installed JDK path, if installed JDK version more, note to select JDK1.4.2 installation path, and then follow the prompts to install it.
After the installation is complete, you can use the J2ME Wireless Toolkit 2.2来 to compile and run the program, the following is an example of a simple HelloWorld procedure to introduce the actual use.
Let's start with a simple example of a J2ME program that displays a form window in the phone that reads "Welcome to the software!" "String, the specific code is as follows:
FileName: Helloworldmidlet.java
Import javax.microedition.midlet.*;
Import javax.microedition.lcdui.*;
/**
* HelloWorld Procedures for J2ME technology
*/
public class Helloworldmidlet extends midlet{
/** Screen Control Object * *
private display display;
/**form Interface Object * *
Private Form MyForm;
/** Default Construction Method * *
Public Helloworldmidlet () {
Get Screen Display objects
display = Display.getdisplay (this);
MyForm = new Form ("title");
Myform.append ("Welcome to the software Newspaper"!) ");
}
public void startApp () {
Set the current display interface
Display.setcurrent (MyForm);
}
public void Pauseapp () {}
public void Destroyapp (Boolean b) {}
}
First save the previous code as Helloworldmidlet.java, and then follow the steps below:
1, open the Program menu J2ME Wireless Toolkit 2.2 in the Ktoolbar.
2, select "New Item", enter in the window that appears, the project name is the Hello,midlet class name is Helloworldmidlet.
3. Copy the Helloworldmidlet.java to the \APPS\HELLO\SRC directory under the J2ME Wireless Toolkit 2.2 installation directory.
4, select the "Build" button in the Ktoolbar interface to compile, and then select the "Run" button can start the simulator to run the program.
The results of this program are shown in the following illustration:
Note: For detailed instructions on J2ME Wireless Toolkit 2.2, refer to the Chinese document in Wireless under the J2ME Toolkit \docs\zh\docs 2.2 installation directory.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.