ood news for mobile application developers: The open source IDEs for J2ME are starting to come into their own. In a recent article on DevX, I reported that Sun’s NetBeans Mobility Pack is worth investigation. The 4.1 release of the Mobility Pack still has room to grow, but it is starting to show signs of being a real productivity booster for Java ME developers. This month I’ll look at EclipseME version 1.1 (http://eclipseme.org), an Eclipse plug-in that assists in the development of J2ME MIDlets. EclipseME 1.0 was just released this summer, and the dot release followed at the end of August.
EclipseME?An Eclipse Plug-in
I am a fan of open source technology. Sometimes I am a fan, not because the open source products are superior, but because I believe they help keep software development costs under control by offering alternatives to high-priced software. But it’s not quite that simple: At the end of the day, the best measure of my success as a software engineer is my productivity. If open source technologies aren’t able to advance my productivity, I simply won’t use them.
For example, when it comes to IDEs it would be hard to separate me from my WebSphere Studio Application Developer (WSAD) for real J2EE project work. I won’t try to tell you that WSAD is the best IDE on the planet, but it works for me, which means it keeps me productive. Because Eclipse and WSAD have common ancestry, I am also a big fan of the base Eclipse IDE. But when it comes to Eclipse plug-ins it’s been a mixed bag. Especially in the J2EE area, a vast number of plug-ins with a variety of issues has frustrated me to the point of giving up on more than one occasion. This is a common complaint when it comes to Eclipse development.
|What You Need
| In order to get EclipseME up and running you will need the following:
Naturally, I feared these same types of plug-in fiascos with EclipseME. But I am happy to report that the EclipseME plug-in integrates easily with Eclipse and appears very stable. Before getting into the pluses and minuses of EclipseME, I’ll take a look at installation and the basics of getting up and running.
Prerequisites for Your Environment
Java and Eclipse, of course, are important prerequisites. JDK 1.4 or better is required. The latest version of the EclipseME (1.1.0) plug-in only works with Eclipse 3.1?the latest version of Eclipse, as of this writing. If you are starting off new in Eclipse, this probably isn’t an issue. However, if you have installed older versions of Eclipse and have wrestled to get certain features of other plug-ins working in your development environment, this may prove to be a pain point. You’ll either have to step back a version in EclipseME (to the 1.0.0 release) or get the new version of Eclipse 3.1 and hope all your other plug-ins still perform as expected. The EclipseME Web site suggests that it will not support Eclipse 3.0 beyond its 1.0.0 version.
Also required is a supported wireless toolkit (see Table 1). Besides those listed in Table 1, EclipseME “supports some toolkits” that meet the Unified Emulator Interface (UEI) specification. UEI provides a standard interface for Eclipse to query the emulator to understand required settings, classpaths, and additional information. So if you use another UEI standard toolkit, it might also work; according to documentation, EclipseME will identify supported toolkits automatically. If your wireless toolkit is not supported, the EclipseME project team encourages you to submit a request for support that will be considered for future release.
Table 1. Supported and Tested EclipseME Wireless Toolkits.
These J2ME wireless toolkits have been tested to work with EclipseME. Others may work if they meet the UEI specification.
|Sun Wireless Toolkits
|Motorola SDK for J2ME
|Nokia Developer Suite 2.2 for J2ME
|Siemens SMTK for Series 60
|Sony Ericsson J2ME SDK
|Sprint PCS Wireless Toolkit for Java 2.0.13
Optionally, if you want obfuscated code (highly recommended?see my earlier article on obfuscation), EclipseME integrates with ProGuard. ProGuard is the same obfuscator used by NetBeans and Sun’s Wireless Toolkit. You have to download and configure ProGuard to work with EclipseME. The download is straightforward, and configuration amounts to telling EclipseME where it can find the ProGuard files.
Additionally, EclipseME supports automatic generation and updates for a set of Antenna build files. Antenna is an Ant extension that provides a set of Ant tasks for building and managing Java ME MIDP applications. EclipseME does many of the tasks Antenna does, but by providing a means to automatically generate and update Antenna build files, you have the ability to share your work with non-EclipseME users.
|Author’s Note: JDK 1.5.0, Eclipse 3.1, Sun’s Wireless Toolkit 2.2, and ProGuard 3.3.1 were used for this article.
Once you have the other tools in place, installation of EclipseME is easy. The EclipseME Web site offers a nice document with explicit instructions on two different methods for installing the plug-in. You can either use Eclipse’s built in update facility to install and update the product via an electronic handshake with the EclipseME Web site or you can download the archive file and manually install the plug-in yourself. Both types of installations are fully documented. For anyone who has used a previous release of EclipseME, it is suggested that you remove any instance of the plug in numbered 0.5.0 or earlier before installing the new plug-in.
If you’re the type who tends to download, install, and get started without reading the documentation, take heed: At a minimum, you should take a second to read the configuration instructions. If you skip this step, you will be sure to have some issues during development (trust me?I tried).
In particular, you will need to
- Configure EclipseME to work with your favorite wireless toolkit using Eclipse’s Preferences Dialog window (see Figure 1).
- While in the Preferences Dialog, change Eclipse’s default debugging settings to allow Eclipse and the EclipseME plug-in to interact with the debugging facility.
- If you plan to obfuscate your application, provide the IDE with information on where ProGuard has been installed.
- If you plan to use Antenna, provide the IDE with information on where the Antenna archive (JAR file) has been installed.
- If you are going to be debugging your MIDlets in OTA mode set up Over-the-Air (OTA) options.
Configuring EclipseME to work with a supported wireless toolkit (see Table 1) is simply a matter of indicating where the toolkit is on your file system and letting EclipseME do the rest of the work. Don’t try to create a new J2ME MIDlet Suite project without configuring the wireless toolkit. If you do, the wizard that allows you to create a project will indicate that a wireless toolkit needs to be configured (see Figure 2).
Also, attempting to use the Eclipse debug facility on your MIDlet without properly setting the debug options will result in all types of errors. Without the debugging configuration specified in the documentation, sometimes the application hangs and other times you get a virtual machine stack dump that is less than obvious in indicating where the problem resides.
Features and Benefits
Eclipse has always provided developers with a very nice and powerful IDE?and one that many Java developers have come to love. The fact that EclipseME is built on top of Eclipse, in my mind, is its biggest feature. With Eclipse comes many features including code resolve, code completion, code formatting, refactoring tools, import assistance, its many code and project views and perspectives, a debugging facility, automatic build capability, a code comparison tool, comment generation, and much more.
As I was preparing this article, I imported some working MIDlets into Eclipse. Within seconds, it was telling me about unnecessary imports and unused methods. That’s what I want my IDE to do?help me work better and faster. Of course, Eclipse’s plug-in architecture also means you have access to a wide variety of additional tools and services. As discussed earlier, plug-ins can be both a positive and a negative with this environment.
Beyond basic Eclipse features, why should J2ME developers look at EclipseME? For one thing, a high-performance IDE. Though I like NetBeans and it has many features that the J2ME developer will want to see in EclipseME and other IDEs (more on this below), Eclipse with the EclipseME plug-in gets up fast, doesn’t garbage collect nearly as often or as long as NetBeans with the Mobility Pack, and shuts down just as quickly. The build process is automatic (unless explicitly turned off) and I also found EclipseME’s interaction with the wireless toolkit for running and debugging applications to be quick as well. Of course Sun’s Wireless Toolkit is fast, but it does not provide you with code editing or real debugging capability.
Another feature of EclipseME is its J2ME MIDlet Suite and MIDlet creation wizards. After getting the tool set up, your first task will probably be creating a J2ME Project. Through the File > New > Project… menu selections in Eclipse, an EclipseME wizard (see Figures 3, 4, and 5) walks you through the creation of a new J2ME MIDlet suite.
Similarly, once a project has been created, an EclipseME wizard helps you create base J2ME MIDlets (see Figures 6 and 7). Through the File > New > Other… menu selections in Eclipse, this wizard will help create the shell MIDlet complete with stubbed MIDlet methods, create appropriate imports, extend and implement coding, and add the MIDlet appropriately to the JAD file.
EclipseME does not yet provide J2ME developers with any special editors (a shortcoming discussed in a bit) save one?the JAD Editor. Anytime you request to see or edit the MIDlet Suite’s Java Application Descriptor (JAD) file, EclipseME brings up the Application Descriptor File editor. This multi-tabbed editor (see Figure 8) allows developers to configure the MIDlets and MIDlet Suite without having to dig into a text file. For developers familiar with Eclipse or WSAD, you will surely recognize the multi-tabbed deployment descriptor type editor that makes working with application configuration a little easier and less error prone.
|Figure 8. The JAD Editor.The JAD editor is a multi-tabbed editor that makes reading and modifying the J2ME MIDlet suites configuration easier and less prone to errors.
As with most J2ME IDE or development tools, EclipseME offers two packaging options. There is a regular JAR/JAD package and an obfuscated JAR/JAD package if ProGuard has been installed and configured to work with EclipseME. A third “packaging option,” if Antenna has been installed and configured, allows EclipseME to generate and export the Ant and Antenna build.xml and properties files. This is a nice feature if team members or customers are not always going to be using EclipseME.
EclipseME’s integration with several UEI toolkits allows building and testing applications on multiple devices. However, the project is associated with the platform definition. Therefore testing an application on each toolkit requires some configuration work. It would also be nice to be able to develop a project where help is provided in dealing with the device fragmentation issue.
Limitations and Shortcomings
As EclipseME is still a “first version” product, it understandably has some growing room. First, the tool does not really offer any type of development tools, wizards, or help with other J2ME classes outside of the MIDlet suite and MIDlet classes. There are no tools to help put together UI components such as Screens (Form, List, etc.) or Canvas, and no tools for creating and using RecordStores or GenericConnections. Graphical editors for creating many of these components would greatly improve the J2ME developer’s productivity. NetBeans has started providing limited graphical J2ME GUI editors, but though NetBeans has a leg up, IDEs still have a long way to go in this area.
While EclipseME allows for the development and packaging of MIDlet Suites, it only allows for the debugging and testing (running) of individual MIDlets. Some users have already submitted this to the bug/enhancement request list hosted at SourceForge.
Project configurations, dealing with the device fragmentation, and providing tools to assist with developing J2ME Web service clients are enhancements that EclipseME has not yet addressed, where other IDEs have started providing preliminary solutions. Also, on the lower end of “wants,” the integration of ProGuard is a start, but I would also like to see options to integrate other obfuscators and/or provide options to tune what/how the code is obfuscated.
Overall, EclipseME (with Eclipse) is a solid development platform for J2ME developers. It may not have the features that NetBeans has, but it performs well and certainly beats using a text editor and Sun’s Wireless Toolkit. Based on some experience with the tool and the tool’s support/bug report pages, EclipseME version 1 appears stable. It is not fancy (beyond the base Eclipse IDE), but provides developers with a real tool to develop and debug real J2ME applications. I would call it a meat-and-potatoes IDE, but one with real promise given its current state and participation in the Eclipse project.
Because it’s built on the well-loved Eclipse, I can’t imagine any J2ME developer who already knows and loves Eclipse passing over this plug-in. All of us are waiting for an IDE with sufficient features for J2ME development?and if enough developers dig in and push for more features now, I’m certain EclipseME will have all the features of NetBeans and more soon.