Java Reference
In-Depth Information
This build script contains targets that correspond to the steps of MIDlet suite development:
compile , preverify , and dist (which packages the application). An obfuscate_null target is
also included; it serves as a placeholder for inserting obfuscation in the build cycle. (The actual
build script in the source download includes a target for obfuscating using ProGuard.)
Several developers have created specialized Ant tasks to help with MIDlet suite builds.
One such project is here: http://antenna.sourceforge.net/ .
Running on a Real Device
As of this writing, millions of MIDP-enabled phones are deployed worldwide. A comprehensive
list of MIDP devices is available at http://wireless.java.sun.com/device/ . How do you actually
put MIDlets on a device? There are two possibilities: either you'll transfer MIDlet suites to the
phone from your computer via an external connection (can be serial cable, USB cable, IRDA,
Bluetooth, etc.—depending on the device manufacturer) , or you'll transfer MIDlet suites over
the wireless network. This second possibility is called over the air (OTA) provisioning . There's a
standard protocol for OTA, included with MIDP 2.0 specification. This protocol is available to
MIDP 1.0 as an addendum to the specification.
Installing MIDlets via serial cable or OTA provisioning is specific to whatever device you're
using. You'll have to check the documentation for your device to see exactly how to install
MIDlet suites.
Summary
This chapter took you on a tour of MIDP development. Creating source code is much the same
as in J2SE development, but the build process is different. First, the source code must be compiled
against the MIDP classes using javac 's -bootclasspath option. Second, the class files must be
preverified using the preverify command-line tool. With the J2ME Wireless Toolkit, these
steps are conveniently automated. Just click the Build button to build and preverify. Applications
can be easily tested in emulators using the J2ME Wireless Toolkit.
Search WWH ::




Custom Search