- Download Palm OS Developer Suite, a complete IDE for Palm OS application development.
- Activate the Eclipse Workbench integrated development environment by selecting
Start > All Programs > PalmSource > Palm OS Developer Suite
Always select a default workspace at
C:\Program Files\PalmSource\Palm OS Developer Suite\workspace
- Create a new project by selecting a wizard:
There are three Palm OS application types:
- Palm OS 68K Application (enough for this course),
- Palm OS 68K Application with PACE Native Objects, and
- Palm OS Protein Application.
There are also two kinds of make :
- Standard Make: provides a generic set of makefiles that you can modify and tailor for your specific application build.
You have to manually update when you make changes to your project (adding files, removing files, changing the output, etc.).
- Managed Make:
dynamically generates your makefile based on the contents of your project folders.
Managed make “watches” your project and automatically updates the makefile when you add files or remove files in your project.
- Give a name to the project:
- Set Palm OS settings:
- Select a code generation template for the project:
- Define the inter-project dependencies, if any:
- Create a Palm OS C/C++ source file, for example:
C:\Program Files\PalmSource\Palm OS Developer Suite\workspace\Hello5\Hello.c
|
#include <PalmOS.h>
// ---------------------------------------------------------------------
// PilotMain is called by the startup code and implements a
// simple event handling loop.
// ---------------------------------------------------------------------
UInt32 PilotMain( UInt16 cmd, void *cmdPBP, UInt16 launchFlags ) {
EventType event;
if ( cmd == sysAppLaunchCmdNormalLaunch ) {
// Display a string.
WinDrawChars( "Hello, world!", 13, 55, 60 );
// Main event loop:
do {
// Doze until an event arrives.
EvtGetEvent( &event, evtWaitForever );
// System gets first chance to handle the event.
SysHandleEvent( &event );
// Normally, we would do other event processing here.
// Return from PilotMain when an appStopEvent is received.
} while ( event.eType != appStopEvent );
}
return ( 0 );
}
|
|
|
†For how to create Palm OS applications, check Palm OS Documentation.
In order to display the current status on the Eclipse, you may need to constantly refresh the project Hello5 by right clicking on the mouse on the project name:
If your project includes resources (.xrd ), you may use the Palm OS Resource Editor at
Start > All Programs > PalmSource > Tools > Palm OS Resource Editor
to create them.
Build the project Hello5 :
Activate a Palm OS emulator by selecting
Start > All Programs > PalmSource > Tools > Palm OS Emulator
Drag the icon of Hello.prc (Palm Application file) at
C:\Program Files\PalmSource\Palm OS Developer Suite\workspace\Hello5\Debug\Hello.prc
to the emulator:
Click on the Hello5 icon to execute the project:
If the application is finalized, synchronize the application to handheld devices by selecting
Start > All Programs > Palm Desktop > Palm Desktop
after downloading Palm Desktop.
|