| Have you ever wanted to write your own video | | | | from your potential market. Note that some |
| games or other applications for mobile phones and | | | | features which are normally only available in MIDP |
| PDAs? Then perhaps you should take a look at | | | | 2.0 can be replicated in devices with MIDP 1.0 |
| Java ME, a popular platform for developing | | | | support via vendor-specific APIs. Using any of |
| applications for mobile devices. This article will get | | | | these APIs, of course, will destroy portability, |
| you started with a quick introduction to Java ME. | | | | unless you want to maintain multiple builds of your |
| We'll talk about what Java ME is, and the different | | | | application. |
| configurations of Java ME that are available on | | | | Additionally, some devices support an extension |
| mobile phones and PDAs. | | | | to Java ME called Mobile Media API (MMAPI). This |
| Simply put, Java ME (formerly J2ME) consists of a | | | | API provides audio and video support, and is |
| Java virtual machine and a set of core APIs | | | | available on some MIDP 1.0 devices. Note that a |
| specifically designed for consumer electronic | | | | subset of MMAPI is included in MIDP 2.0. Support |
| devices. If you are interested in writing video | | | | for MMAPI tends to be limited to higher-end |
| games, your target devices will probably be | | | | phone, so keep that in mind when exploring this |
| mobile phones, and PDAs, such as Blackberry and | | | | option. |
| Palm. (Sadly, Java ME support on Pocket PC | | | | For example, my personal mobile phone is a |
| devices is almost non-existent.) This being said, | | | | Sanyo PM-8200, which only supports CLDC 1.0 |
| you don't have to limit your code to only work on | | | | and MIDP 1.0. As a result, all of my current |
| one particular type of device. Java ME allows you | | | | applications are built for that environment. For one |
| to choose an environment which meets the | | | | of my applications, I wanted to release a version |
| requirements of your application, and only devices | | | | with sound, but there are no sound APIs in MIDP |
| supporting that environment will be able to run it. | | | | 1.0. For this project, I decided to release two |
| Since this is Java, you need not be concerned | | | | versions of the application, one that only used the |
| with the manufacturer, wireless carrier, or | | | | core CLDC 1.0 and MIDP 1.0 APIs, and another |
| hardware of the target device. This is, of course, | | | | which also used a proprietary Sprint PCS |
| unless you decide to use any vendor-specific | | | | extension for playing sounds. The two versions |
| extensions (more on that later). | | | | had the same code base, with one difference. |
| The Java ME environment has two important | | | | The sound-enabled version used a subclass of my |
| components, the configuration and the profile. The | | | | base MIDlet class that included calls to the sound |
| configuration defines the base functionality of the | | | | APIs. In my base MIDlet class, these methods |
| Java ME environment, such as the specifications | | | | were simply stubbed out. In the NetBeans IDE, |
| of the virtual machine, and which set of core | | | | these were represented as two different |
| APIs is available. For devices such as the ones | | | | deployments, one which used the base class as |
| mentioned above, you will be using Connected | | | | the MIDlet and the other which used the subclass |
| Limited Device Configuration (CLDC). | | | | with the calls to the Sprint PCS sound API. In |
| The profile defines the higher level capabilities of | | | | addition, I made sure to remove the sound |
| the environment; for mobile phones and PDAs, | | | | resources from the deployment without sound |
| this will be the Mobile Information Device Profile | | | | support. |
| (MIDP). Here is where you will have to make a | | | | Which option you choose will depend on the |
| decision. There are currently two versions of | | | | requirements of your application, and which set of |
| MIDP, 1.0 and 2.0. The later provides additional | | | | devices you wish to support. Generally, you want |
| features for multimedia and gaming, but at a cost. | | | | to choose the minimum environment which fulfills |
| If you go with MIDP 2.0, you will be excluding a | | | | your requirements, in order to maximize the |
| large set of devices which only support MIDP 1.0 | | | | potential market for your application. |