The Wayback Machine - https://web.archive.org/web/20141022043536/https://developer.palm.com/content/api/dev-guide/pdk/overview.html

PDK Overview

Introduction

The Plug-In Development Kit (PDK) is a component of the HP webOS SDK that lets developers use C and C++ alongside the web technologies that power the SDK, and even mix them seamlessly within a single application. The PDK brings additional functionality to webOS, including immersive 3D graphics, and gives developers who have built games for other platforms an easy way to bring their titles to the webOS platform.

The webOS PDK takes its name from the way that C/C++ components integrate into webOS applications. The webOS platform is built on standard web technologies, with an application environment built on the WebKit browser engine. Components built with the PDK plug in to webOS apps using the same mechanism that supports desktop browser plug-ins.

We have created the webOS Plug-in Development Kit with the following objectives:

  • Easy porting of C/C++ applications to webOS, especially games that use SDL or OpenGL ES (1.1 or 2.0) for 3D graphics
  • Easy integration of C/C++ components to enhance the capabilities of webOS applications

The PDK includes its own tools to support development and debugging of plug-ins for webOS applications, and (like the webOS SDK) enables development on the Windows and Mac platforms. In the near future, support for PDK development on Linux platforms will also be available.

Besides running applications directly on the webOS device itself (throughout this documentation, the target phone for development is referred to as the device), developers have the option to use the PDK's Desktop Environment for testing applications on their host PC.

image
Figure 1: A Palm Pre smartphone
(aka the device) attached to a PC
via a USB cord, ready for application
development.

image
Figure 2: The sample application
provided with the PDK, displaying
a red, multi-sided rotating shape
running on a host PC in its own
app window.

Core Technologies

The webOS Plug-In Development Kit is built on the following technologies:

  • GCC for compiling C/C++ code to ARM native code. webOS devices use ARM (Advanced RISC Machine) processors running an embedded Linux OS.

  • OpenGL ES 1.1 or 2.0 -- A standard specification defining a cross-language, cross-platform API (> 250 functions) for writing applications producing 2D and 3D computer graphics.

  • Simple DirectMedia Library (SDL) -- A free, cross-platform, open source software multimedia library, written in C, designed to provide low-level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL ES, and a 2D video frame buffer. In addition to the SDL core library, the following separate, but officially recognized and supported libraries, are also included:

    • SDL_image -- Support for multiple image formats
    • SDL_mixer -- Complex audio functions, mainly for sound mixing
    • SDL_ttf -- TrueType font rendering support
    • SDL_net -- Networking support
  • Palm Development Library (PDL) -- A library of functions that extend SDL capabilities specifically for webOS devices.

  • SDL_cinema -- Functions required for playing video on the device.

The PDK enables you to develop and test your applications on both your host PC and on the device itself.

Desktop development

You can build and test applications using the code libraries that are installed with the PDK. For testing, desktop versions of all libraries are provided. This allows you to develop and debug your applications from within your preferred Integrated Development Environment (IDE) such as Visual Studio and Xcode. You can use your IDE as a preliminary development environment before testing on the device itself. Apps built in the IDE and launched on the desktop can do the following:

  • Emulate input events using the keyboard or a joystick
  • Receive single, multi-touch, and accelerometer events
  • Access the network
  • Play audio

Device development

The device webOS contains, for run-time, the same libraries that you can use in desktop development. The PDK contains tools you can use for packaging, installing, testing and debugging your app on the device.

Prerequisites

Currently, the PDK supports development on two platforms:

  1. Windows PCs
  2. Apple Macs

Target audience

It is assumed the reader has some understanding of the following:

  • C Programming
  • OpenGL (for 3D graphics)
  • Graphics programming

All host PCs

Windows

  • Windows — XP or higher. Windows Vista and 7 are supported, but without UAC (User Account Control) turned on and not on 64-bit platforms.

  • Visual Studio — Any version that supports C/C++ should work for developing apps; 2003, 2005 and 2008 have been tested. This is optional, necessary only for desktop development and testing.

Mac

  • Mac OS — Leopard or Snow Leopard.

  • Xcode IDE — This is optional, necessary only for desktop development and testing.