|
Developers usually build, test, and evaluate an application on a platform similar to the one on which it will be deployed and run. Development of wireless Java applications is more challenging because they typically are developed on one platform (such as Solaris or MS Windows) but deployed on a totally different one (such as a cell phone or PDA). One consequence is that, while emulators enable developers to do some of their testing on the development platform, ultimately they must test and evaluate the application in the very different environment of a live wireless network. The aim of this article is to show you the different ways you can download local and network applications to J2ME-enabled devices, for both testing and final deployment. After a brief review of wireless Java applications and their development life-cycle, the article shows you how to:
Wireless Java ApplicationsWireless Java applications fall into two broad categories:
Although these two types of applications are different, they are deployed in the same way. The big difference shows up later: Local applications are easier to test than network applications. For example, a calculator application can run on a wireless phone even when it is not connected to any network, but an email client won't work without a connection to the SMTP server that actually transmits the messages.
Wireless Java Applications Development LifecycleThe development life-cycle of MIDlets and other wireless Java applications comprises three steps:
This article's focus is on that last step: deploying and testing the application on a physical device.
Deploying and Running Remote Applications
The J2ME Wireless Toolkit enables you to run your local wireless
application from within the development environment; the JAD and JAR files
are available on your own system (if you're using the J2ME Wireless Toolkit,
in
Remote DeploymentTo deploy your wireless applications remotely:
Running Remotely Deployed ApplicationsTo see whether your application deployed correctly, open an ordinary web browser and enter the JAD file's URL. The J2ME Wireless Toolkit's default emulator should appear and the remotely deployed application should run in it.
J2ME-enabled devices (the Motorola/Nextel i85s, for example) include a Java Application Manager (JAM)
responsible for downloading, installing, and configuring applications. The
J2ME Wireless Toolkit includes a sample JAM you can run in the default emulator.
To see how the user will download and manage your application, open a command
prompt, change the current directory to
The emulator appears and you see the JAM's main screen. In version 1.0.4 of the toolkit, the main screen looks like this:
Figure 1: The J2ME Wireless Toolkit Java Application Manager's Main Screen Select the Install soft button and you will be prompted for the application's URL, as shown in Figure 2. Enter the URL of a web page that contains a hyperlink to the application's JAD file.
Figure 2: Entering the URL for the Application's JAD File Entering a long URL into a wireless phone is inconvenient. A faster and easier way to get started is to use a command in this form:
Without further entry, the JAM downloads the JAR file specified in the JAD file and installs the application. The next time you start the emulator, simply select the JAM's Menu button, then use the menu to run the application, remove it, or perform the other functions shown in Figure 3:
Figure 3: The JAM's Main Menu
It is important to note that this syntax allows you to install only
one MIDlet at a time. Entering a URL allows you to view a web page that may
contain several MIDlets you can choose from. As an example, consider the
following HTML file (
It is important to note that the hyperlinks point to the
application's JAD file. Now, enter the URL into the install window as shown
in Figure 4. (The IP address
Figure 4: Entering a URL in the Install Window
The JAM reads the HTML doccument (
Figure 5: Links to Downloadable MIDlets Now you can select a MIDlet to download. The JAM reads the JAD file to discover whether the device is capable of handling the application. If so, it downloads and installs the JAR file specified in the JAD file. Once the games MIDlet is downloaded and installed, you will see a display similar to Figure 6. Note that games.jad is the MIDlet suite that comes with the J2ME Wireless Toolkit.
Figure 6: The MIDlet Suite of Games Downloaded and Installed The JAM is smart enough to notify you if you try to install a MIDlet that's already on your device, as in FIgure 7. It will, however, allow you to download an updated version of the MIDlet.
Figure 7: Warning That MIDlet Is Already Installed
Deploying and Running Applications on Physical DevicesDeploying and running applications in an emulation environment is a very good way to test the logic and flow of your application generally, but you won't be certain it will satisfy users until you test it on a real physical device connected to a wireless network. Your application's performance may be stunning in the emulator, which has all the processing power and memory of your desktop machine at its command, but will it perform well on the handheld device, with its limited memory and processing power, low bandwidth, and other constraints? To perform realistic tests you need a J2ME-enabled physical device, and a data cable to connect it to your desktop. For this article
Deploying Local ApplicationsIf you have a Motorola J2ME-enabled phone, you can download stand-alone applications using the Motorola Java Application Loader Lite (JAL Lite). Note that JAL Lite limits filename lengths to 16 characters, and expects an application's JAD and JAR files to be in the same directory. Connect the phone to your desktop and start JAL Lite on your desktop. You'll see a window like the one in Figure 8:
Figure 8: Motorola JAL Lite The application displays the MIDlets already installed on the device. To install a new application, click on the Connect button, then the Download button. The application loader lets you browse your hard disk and select a JAD file. As soon as you do, it begins downloading the application and displays a progress indicator as shown in Figure 9:
Figure 9: JAL Lite Downloading an Application to the Phone Once the download is complete, click on the Disconnect button, and disconnect the phone from the data cable. When you browse through the Java applications available on the phone, you should see the application you just downloaded. Select it and you will be asked if you wish to install it. If you answer yes, the application will be installed and you can start using it. The application remains on the phone until you explicitly remove it.
Buying and Deploying Remote ApplicationsYou can use JAL Lite and the data cable to download local applications to a wireless phone from your desktop, including freely available applications you first download to your desktop using HTTP or FTP. Many useful applications are accessible only if you use special tools, however, usually because developers and wireless carriers wish to charge people for downloading them. There are two ways to download remotely deployed applications:
Figure 10: Motorola iDEN Update (click for full size)
Downloading Applications Over The AirFor some time, wireless portals in Europe such as Midletcentral have allowed customers to download applications directly to their phones, over the air. Over-the-air provisioning of wireless applications (OTA) is finally available in North America. Nextel customers, for example, can download network-aware wireless applications without an update data cable. OTA is the deployment of wireless Java applications (MIDlet suites) from the Internet to wireless devices over a wireless network. Users need not connect their devices to the desktop with a data cable or visit a service center to install or upgrade software. See Over The Air User Initiated Provisioning Recommended Practice for the Mobile Information Device Profile for details. To take advantage of OTA, you must equip your handheld device with a mechanism to discover MIDlet suites available for download, using the device's browser (such as a WAP browser) or a resident application written specifically to identify downloadable MIDlet suites. The process of downloading MIDlets over the air is illustrated in Figure 11.
Figure 11: Over-the-Air Provisioning of MIDlets (click for full size) Conclusion: Many Java-enabled wireless devices are already out there, and the necessary wireless infrastructure is in place to begin deploying wireless applications. This article discussed several ways to deploy and test local and remote wireless Java applications. To succeed in the wireless market, you need to develop
relationships with other developers, device manufacturers, content developers,
and wireless carriers. Several device manufacturers (such as Nokia) and wireless
carriers (such as Nextel) offer developer programs that can help you market
your dazzling wireless Java application.
For more information
AcknowledgmentsSpecial thanks to Gary Adams, Nicolas Lorain, and Jonathan Knudsen for their contributions to this article. 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.
|
| ||||||||||||