webOS Q&A Metrix App Mill Forums About Contact Tip Us

Porting Lopan to webOS

By: , 9/30/2010 5:17 pm | 6 comments

Lopan Mahjongg Solitaire FREE

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.

Download it now.

flattr this!


About Roy Sutton

Roy has been active in the Palm developer community since just after the Palm Pre was released. He has been a mobile developer for far longer than the term 'mobile computing' has been around. During the day, he develops software and systems for barcode and RFID data collection. He has published two apps for webOS and has several more in the pipeline. He was formerly editor at Pre 101.
  • Chris

    I love when developers talk about how easy it is to port programs to webOS. I just wish more developers would give it a shot.

  • Rsanchez1990

    I know, right? If EA can port The Sims 3 to webOS without too much difficulty, anyone can port their games.

  • http://www.webosroundup.com/ Roy Sutton

    I just wanted to let people know that I believe I’ve discovered the cause of the random shutdowns since the latest version. Moving to OpenGL (to support the Pixi) has caused increase RAM usage and I did not update the RAM requirement for the app. Apparently webOS will kill apps that go over their RAM limit for too long!

  • http://www.webosroundup.com/ Roy Sutton

    I just wanted to let people know that I believe I’ve discovered the cause of the random shutdowns since the latest version. Moving to OpenGL (to support the Pixi) has caused increase RAM usage and I did not update the RAM requirement for the app. Apparently webOS will kill apps that go over their RAM limit for too long!

  • johnny

    hey roy downloaded your app and hope you got pushed up the ladder the past few days in the hot apps. wish i had known about it sooner.

  • http://twitter.com/zerosaves Sean L

    Awesome. I downloaded this before I knew you made it, heard that on the podcast today and thought cool! anyway GL with winning a K or Envy.