Porting Lopan to webOS

Recently I had the opportunity to port Lopan, a mahjongg solitaire game, to webOS. I wanted to work on a project that would be a gentle introduction to Palm’s Plug-in Development Kit (PDK). Also, I wanted to develop a game that I would enjoy playing and taking a shot at Palm’s hot apps contest was the perfect motivation. If you’re more interested in playing the game than hearing about how I converted it, click here.
Palm’s PDK uses several standard methods for producing plug-in applications (those applications not built using Web technologies). Among the libraries supported are the SDL library and OpenGL ES. If an application uses these and was written in C or C++ then porting is a very simple process: Within 30 minutes I had Lopan running on webOS.
My first step was to download and install the PDK from Palm’s developer portal. From there, I compiled Lopan for my PC using the libraries included with the PDK. Being able to run the same application on my desktop and the phone sped up development. Once I had a working application I added in the calls to initialize the Plug-In Development Library (PDL), the interface to the unique features of webOS devices. One potential pitfall was that my application expected a 600×400 window to render in. Fortunately, the SDL includes an option called SDL_FULLSCREEN that, in the case of webOS devices, causes the screen to shrink to fit automatically.
The most difficult part of bringing the application over to webOS was the additional polish and integration users expect from webOS applications. Fortunately, Palm has included many useful functions to receive information from the phone. I spent a lot more time adding new features than I did getting it running the first time. I’m very pleased with the result and I think you will be, too.





















