|
MIDlets are small applications written in the Java programming language that
run in all mobile phones and two-way pagers that support the Mobile Information
Device Profile (MIDP). To create and test MIDlets, to install the software,
configure your system, and create a descriptor file for the MIDlet. This article
explains how and concludes with instructions on compiling and running the
Installing the Software Currently, Windows is the only platform on which the MIDP reference implementation is certified; however, the Connected Limited Device Configuration (CLDC) is available for the Windows and Solaris platforms, and the JDK platform is available for Windows, Solaris, and Linux. To write MIDlets, download and install the following software for the Windows platform:
Download and unzip the above software in the following recommended directory structure:
This article assumes that directory is You do not need to build your own environment unless you are going to port your applications to other platforms. The MIDP and CLDC downloads require minimal setup to develop and test applications with the MIDP software. Setting Up
To set up your environment to locate class files, tools, and commands, update your path settings to point to the MIDP and JDK workspaces. Set Environment Variables
Set the
Check Environment Variable Settings
Set Screen Depth for Color Display
The phone image at the right appears in your window. You are now ready to develop and test an MIDP application. Writing the Descriptor File for
The descriptor file to run the
Compiling, Preverifying, Packaging, and Running Before running your program, compile, preverify, and package your MIDlet. Compiling
To compile the C:\javac -d .\ -bootclasspath c:\pathTo\MIDP\classes HelloMIDlet.java Preverifying This command preprocesses the program for use by the K virtual machine (KVM) without changing the name of a class. Skipping this step will produce an error if you try to run your application.
To process with preverify, type C:\preverify -classpath c:\j2me\MIDP\classes; C:\Examples\ FirstMIDlet
A preverified class file is written to the directory
Test the example from the C:\Example\output>midp FirstMIDlet Packaging
To package the C:\jar cf hello.jar HelloMIDlet.class Running To execute the example, type the following: C:\midp -descriptor hello.jad You can find more information on descriptor files, and how to run and test MIDlets in the article Wireless Application Programming: MIDP Programming and Packaging Basics. Back To Top | ||||||||||||||||||||||||||||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||