Home > Articles > Programming > Java

Java On Pocket PC Devices

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss
Have you ever wondered how to create Java applications for Pocket PC devices? These gadgets have become come more and more popular with businesspeople, students, and other folks who appreciate the connections to Microsoft Office applications. Read Mikko Kontio's tips on how to get started and where to find more information.

Pocket PC devices have become more and more popular during the last few years. Businesspeople, students, and others have learned the value of portable devices—and especially their connections to Microsoft Office applications. Their biggest competitors are Palm OS devices, smart phones, and the lightest laptops.

Java has become quite popular, especially among mobile phone users. Its wide variety of applications, mostly games, is available and easy to buy. Palm OS and Pocket PC devices don't have the same kind of built-in easy installation techniques that mobile phones with MIDP (Mobile Information Development Profile) have. So buying and installing Java software for Palm OS or Pocket PC devices can be quite challenging for the less-than-tech-savvy folks among us.

There are three ways to develop software for Pocket PCs with Java: by using MIDP, Personal Java, and third-party technologies. This article examines what the development consists of with these technologies and also takes a look at possible runtime environments, virtual machines, which are on the market.

MIDP Applications on the Pocket PC

MIDP is a Java API for mobile information devices (mostly mobile phones). MIDP is wildly popular; in fact, most of today's phone models have MIDP 1.0 or 2.0.

It is possible to run MIDP applications (or MIDlets, as they are called) in Pocket PC devices. To run them, you need to install a virtual machine for MIDP first; then you can run your MIDlets with the JVM. IBM's WebSphere Studio Device Developer is an integrated development environment that has all the necessary tools for deploying J2ME software for multiple platforms. There is a file (in English: midpng.ppc.cab) that allows you to run MIDlets. First, you need to install the cab file and then install the MIDlets. There's a free evaluation version, so give it a try.

Listing 1 shows what the body of an MIDP application looks like. The HelloMIDlet class is the main class of the application; the startApp(), pauseApp(), and destroyApp() methods need to be implemented for the VM. The commandAction() method is implemented because the MIDlet implements the CommandListener interface, which allows it to react to user inputs.

Listing 1 The Body of a MIDlet.

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class HelloMidlet extends MIDlet implements CommandListener{
 
  public void startApp(){
   // When the application is started,this method gets called
  }

  public void pauseApp(){
   // When the application is paused,this method gets called
  }

  public void destroyApp(boolean unconditional){
   // When the application is killed,this method gets called
  }

  public void commandAction(Command command, Displayable screen){
   // If the command is the doneCommand
  }
}
  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Danny KalevMinutes from the October 2009 Meeting
By Danny Kalev on November 19, 2009 No Comments

The minutes from the Santa Cruz (October 2009) meeting are available here. Even if you're not a language layer at heart, I encourage you to read them.

Danny KalevA Reader's Opinion on Attributes
By Danny Kalev on October 20, 2009 No Comments

In August I dedicated a series to the debate about C++0x attributes. I believe that it covered the subject in a balanced and detailed way, but I keep getting complaints from C++ users who don't like attributes for various reasons. Here's a recent email I received from a Polish C++ programmer. While it  doesn't represent my opinion about attributes -- I'm rather neutral about this feature and consider it a "solution waiting for a problem" -- but it suggests that attributes are still a highly controversial issue that will haunt C++ for a long time. The email is quoted here with minor edits that and as usual, with all private details removed.

Danny KalevFollowup: The Web 2.0 Guy I Ain't
By Danny Kalev on October 16, 2009 1 Comment

Almost a year ago, I posted here The Web 2.0 Guy I Ain't. People wonder whether I still resist all those Web 2.0 features and technologies at the end of 2009.

See All Related Blogs

Informit Network