Wednesday, January 23, 2008

Class Info: How to create a midlet

A midlet is a java program that runs on a cell phone. First, a little background on Java -- there are different versions of Java. There is a Java version called J2EE which is an acronym for Java 2 Enterprise Edition. There's a version that runs a a computer that allows already compiled programs to run called the JRE or Java Runtime Environment. There's one called EmbeddedJava. A scaled down version of the J2EE called the J2ME, which stands for Java 2 Platform, micro edition runs on cell phones. The J2ME is what we use to create midlets. For a Wikipedia definition of a midlet see: http://en.wikipedia.org/wiki/MIDlet.

There are 7 steps to create a midlet. The steps are: (1) Design, (2) Code, (3) Compile, (4) Deploy, (5) Test, (6) Package, and (7) Preverify. You are already familiar with the first three steps: Design, Code, and Compile. For a cell phone, we have to think about the size of the screen and the other cell phone limitations and capabilities in the Design step. In the Code step, we can use BlueJ as we have done for our other projects. However, when we code for a cell phone, we need to include some special libraries with an import command. When we compile a Java program for a cell phone, we have to specify something called the CLASSPATH. The classpath is the subdirectory on a cell phone where the program will look for the libraries it will use. For more info on a classpath, see this Wikipedia article: http://en.wikipedia.org/wiki/Classpath_(Java)
We will go over each step in detail. If you would like a head start, there is a tutorial at http://today.java.net/pub/a/today/2005/02/09/j2me1.html?page=2

But, for our first HelloWorld cell phone program, we will be using the CASE method and will modify the MyFirstMidlet midlet.

0 Comments:

Post a Comment

<< Home