| Java ME Mobile Phone Applications - The Good, the Bad and the Ugly - The Good |
| Written by Kon Katsaros | ||||||||
| Thursday, 31 May 2007 00:00 | ||||||||
Page 3 of 6
The GoodFirst, let’s briefly cover some of the great things about Java ME. This will also give us a little background about how it works. Extensive Core FeaturesThe core features provided by Java ME implementations cover most things you would ever want your application to do on a mobile phone. This includes:
Many (but not all) newer Java ME implementations (phones less than two years old), also provide additional features, depending on the device capabilities. For example
The Java Community Process website holds all the Java ME-related specifications, which describe optional functionalities that can be provided by an implementation if the vendor chooses to include them. There are over 80 sets of Java ME-related specifications currently available. For example, if a device has GPS support, then the implementation on that device may provide the Java ME Location API. This would allow applications to retrieve and use GPS coordinates. It’s EasyIt’s easy to develop a Java ME application if you already have experience with Java. In fact, Java ME development involves using a cut-down version of Java Platform, Standard Edition (Java SE). Many of the classes and interfaces are the same as the ones in Java SE (for example, String, Thread, Runnable, Reader and Writer). The real difference is that, as opposed to Java SE, there are just a lot less classes in Java ME. Indeed, it could be argued that developing a Java ME application is simpler than developing a Java SE application. Device Implementation AvailabilityJava ME is everywhere! Java ME implementations are installed on hundreds of different types of mobile phone handsets, which results in it being available on millions of mobile phones world wide. If you wish to deliver an application to the general public on an assortment of different phone devices, a Java ME application is one of the few options available right now. For a list of devices which support Java ME, see here. PortabilityJava ME allows mobile phone applications to run on diverse devices - without recompilation. For those who don’t know, a Java ME application is delivered as a group compiled class and data files stored inside a JAR file. Additionally, a small descriptor file – known as a ‘JAD’ file - is generally provided to describe the contents of the JAR. The JAR and JAD files are collectively referred to as a “package”. In most situations, a package can be successfully delivered to devices from various vendors (ie, Nokia, Motorola, LG, Sony-Ericson, etc) without change or recompilation. When you think of the variety of mobile phones that are available, it’s amazing that it works. Vendors have gone to great lengths to implement Java ME onto their devices from the factory, and to ensure that it works correctly. I believe that this investment will continue and that Java ME will be around for a very long time. ToolsThere are many excellent tools for creating and packaging Java ME applications. Many emulators have plugins to help manage code (e.g. the eclipseme plugin for eclipse IDE). There are also as several Ant-driven build scripts (e.g. antenna and J2ME Polish). However, one tool that is a “must have” for development of Java ME applications is the Sun Java Wireless Toolkit (WTK). Indeed, it should be your first choice for compiling and packaging applications. Whilst it does not include a facility for editing code, it does include everything else that is required, including means for arranging, compiling, verifying, signing, packaging, deploying and testing Java ME applications. The standout feature of the WTK is the device emulator. This is a mobile phone reference implementation for Java ME. It is run on the development platform, provides a mock “mobile phone” on your desktop and looks something like this:
The WTK emulator greatly reduces testing time and effort. All J2ME functionality of an application can be tested on the emulator. And once an application works correctly on the emulator it can be deployed onto real devices for further testing and fine-tuning. DeploymentJava ME application deployment onto real devices is usually painless. Deploying the application over the internet - generally referred to as "Over the Air” (OTA) - is the most popular way of deploying applications to the public. However, to get an application onto a device this way, there are a few prerequisites:
Once these prerequisites are satisfied, then it’s simply a matter of starting the mobile phone browser and typing in the URL for the application software; the Java ME implementation will do the rest. It will download the application, and automatically start the install process. An alternative to deploying OTA is to download the package onto a computer, and then deploy from the computer to the mobile phone using technology such as Bluetooth. This mechanism works particularly well on Nokia mobile phones. |