Documentation  |   Table of Contents   |  < Previous   |  Next >   |  Index

Table of Contents

Programming Basics

Exploring Palm OS®

About This Document

The Exploring Palm OS Series

Additional Resources

Changes to This Document

3107-002

3107-001

Part I: Concepts

1 Programming Palm OS in a Nutshell

Why Programming for Palm OS Is Different

Screen Size

Quick Turnaround Expected

PC Connectivity

Input Methods

Power

Memory

File System

Backward Compatibility

Palm OS Programming Concepts

API Naming Conventions

Integrating Programs with the Palm OS Environment

Writing Robust Code

Uniquely Identifying Your Palm OS Application

Making Your Application Run on Different Devices

Processor Differences

Running New Applications on an Older Device

Compiling Older Applications with the Latest SDK

Programming Tools

Where to Go from Here

2 Application Start and Stop

Launch Codes and Launching an Application

Responding to Launch Codes

Responding to Normal Launch

Responding to Other Launch Codes

Launching Applications Programmatically

Sublaunching in Another Process

Creating Your Own Launch Codes

Stopping an Application

Launch Code Summary

Application Manager Function Summary

3 Events and the Event Loop

Palm OS Events

The Structure of an Event

The Application Event Loop

Retrieving Events

Handling System Events

Handling Menu Events

Handling Form Load Events: the AppHandleEvent() Function

Handling Form-Specific Events

Using Events to Communicate Between Threads

Communicating Between Threads in a Single Process

Communicating Between Threads in Different Processes

Palm OS-Generated Events

Summary of Event APIs

4 Notifications

Notification Overview

Registering for a Notification

Writing a Notification Handler

Sleep and Wake Notifications

Helper Notifications

When to Use the Helper API

Requesting a Helper Service

Implementing a Helper

Notification Summary

Notification Function Summary

Part II: Reference

5 Application Manager

Application Manager Structures and Types

ARMAppLaunchPrefsType

ImportExportRecordParamsType

SysAppLaunchCmdCardType

SysAppLaunchCmdFailedAppNotifyType

SysAppLaunchCmdHandleSyncCallAppType

SysAppLaunchCmdInitDatabaseType

SysAppLaunchCmdOpenDBType

SysAppLaunchCmdPnpsType

SysAppLaunchCmdSaveDataType

SysAppLaunchCmdSyncCallApplicationTypeV10

SysAppLaunchCmdSystemResetType

PilotMainType

Application Manager Constants

Expansion Card Launch Flags

Launch Preference Flags

Launch Preferences Structure Versions

Miscellaneous Application Manager Constants

Application Manager Functions and Macros

PilotMain

SysAppLaunch

SysAppLaunchLocal

SysAppLaunchRemote

SysAppLaunchV40

SysBroadcastActionCode

SysCurAppDatabase

SysCurAppDatabaseV40

SysGetStackInfo

SysReset

SysUIAppSwitch

SysUIAppSwitchV40

6 Common Launch Codes

Common Launch Codes Structures and Types

GoToParamsType

Common Launch Codes Constants

Launch Flags

Miscellaneous Common Launch Codes Constants

Common Launch Codes

sysAppLaunchCmdAddRecord

sysAppLaunchCmdAntennaUp

sysAppLaunchCmdCardLaunch

sysAppLaunchCmdCountryChange

sysAppLaunchCmdDeleteRecord

sysAppLaunchCmdEventHook

sysAppLaunchCmdExportRecord

sysAppLaunchCmdExportRecordGetCount

sysAppLaunchCmdFailedAppNotify

sysAppLaunchCmdFepPanelAddWord

sysAppLaunchCmdFinalizeUI

sysAppLaunchCmdFind

sysAppLaunchCmdGoTo

sysAppLaunchCmdGoToURL

sysAppLaunchCmdHandleSyncCallApp

sysAppLaunchCmdImportRecord

sysAppLaunchCmdInitDatabase

sysAppLaunchCmdInitializeUI

sysAppLaunchCmdLookup

sysAppLaunchCmdLookupWord

sysAppLaunchCmdMoveRecord

sysAppLaunchCmdMultimediaEvent

sysAppLaunchCmdNormalLaunch

sysAppLaunchCmdNotify

sysAppLaunchCmdOpenDB

sysAppLaunchCmdPanelCalledFromApp

sysAppLaunchCmdPinletLaunch

sysAppLaunchCmdReturnFromPanel

sysAppLaunchCmdRun68KApp

sysAppLaunchCmdSaveData

sysAppLaunchCmdSlipLaunch

sysAppLaunchCmdSyncCallApplicationV10

sysAppLaunchCmdSyncNotify

sysAppLaunchCmdSyncRequest

sysAppLaunchCmdSyncRequestLocal

sysAppLaunchCmdSyncRequestRemote

sysAppLaunchCmdSystemLock

sysAppLaunchCmdSystemReset

sysAppLaunchCmdTimeChange

sysAppLaunchCmdURLParams

sysAppLaunchNppiNoUI

sysAppLaunchNppiUI

sysAppLaunchPnpsPreLaunch

sysAppLaunchPreDelete

sysCncPluginLaunchCmdGetPlugins

sysCncPluginLaunchCmdRegister

sysCncPluginLaunchCmdUnregister

sysCncWizardLaunchCmdEdit

sysDialLaunchCmdDial

sysDialLaunchCmdHangUp

sysIOSDriverInstall

sysIOSDriverRemove

sysLaunchCmdAppExited

sysLaunchCmdBoot

sysLaunchCmdFinalize

sysLaunchCmdGetGlobals

sysLaunchCmdGetModuleID

sysLaunchCmdGraphicsAccelInit

sysLaunchCmdInitialize

sysLaunchCmdInitRuntime

sysLibLaunchCmdGet68KSupportEntry

sysLaunchCmdProcessDestroyed

sysPackageLaunchAttachImage

sysPackageLaunchGetInstantiate

sysPinletLaunchCmdLoadProcPtrs

sysSvcLaunchCmdGetQuickEditLabel

sysSvcLaunchCmdGetServiceID

sysSvcLaunchCmdGetServiceInfo

sysSvcLaunchCmdGetServiceList

sysSvcLaunchCmdSetServiceID

7 Event

Event Structures and Types

EventType

EvtQueueHandle

SysAppLaunchCmdBackgroundType

Event Constants

Event Flags

Event Dispatch Types

Event Error Codes

Miscellaneous Event Constants

Event Launch Codes

sysAppLaunchCmdBackground

Event Functions and Macros

EvtAcquireEventQueue

EvtAddEventToEventQueue

EvtAddEventToQueue

EvtAddEventToQueueAtTime

EvtAddUniqueEventToEventQueue

EvtAddUniqueEventToQueue

EvtAddUniqueEventToQueueAtTime

EvtCreateBackgroundThread

EvtDequeueKeyEvent

EvtDequeuePenPoint

EvtDequeuePenStrokeInfo

EvtEnqueueKey

EvtEventAvail

EvtEventToString

EvtFinishLastEvent

EvtFlushKeyQueue

EvtFlushNextPenStroke

EvtFlushPenQueue

EvtGetEvent

EvtGetEventDescriptor

EvtGetFocusWindow

EvtGetPen

EvtGetPenNative

EvtGetReplyEventQueue

EvtGetThreadEventQueue

EvtKeydownIsVirtual

EvtKeyQueueEmpty

EvtLookupEventQueue

EvtPublishEventQueue

EvtReleaseEventQueue

EvtSetNullEventTick

EvtSetPenDispatchFunc

EvtSysEventAvail

EvtWakeup

EvtWakeupWithoutNilEvent

Application-Defined Functions

EvtPenDispatchFunc

8 Event Codes

Event Codes Structures and Types

eventsEnum

Event Codes Constants

Miscellaneous Event Codes Constants

Event Codes Events

appStopEvent

nilEvent

prgMakeCallback

prgUpdateDialog

9 Helper

Helper Structures and Types

HelperNotifyActionCodeType

HelperNotifyEnumerateListType

HelperNotifyEventType

HelperNotifyExecuteType

HelperNotifyValidateType

Helper Constants

Action Codes

Miscellaneous Helper Constants

Helper Notifications

sysNotifyHelperEvent

10 Helper Service Class

Helper Service Class Structures and Types

HelperServiceEMailDetailsType

HelperServiceSMSDetailsType

Helper Service Class Constants

Helper Service Class IDs

11 Notification Manager

Notification Manager Structures and Types

SleepEventParamType

SysNotifyAppLaunchOrQuitType

SysNotifyDBAddedType

SysNotifyDBChangedType

SysNotifyDBCreatedType

SysNotifyDBDeletedType

SysNotifyDBDirtyType

SysNotifyDBInfoType

SysNotifyDisplayChangeDetailsType

SysNotifyLocaleChangedType

SysNotifyParamType

SysNotifyPenStrokeType

SysNotifyVirtualCharHandlingType

Chapter 5, "Low-Level Events Reference,"Notification Manager Constants

Reasons for Device Sleep

Database Changed Flags

Miscellaneous Notification Manager Constants

Notification Manager Notifications

cncNotifyConnectionStateEvent

sysExternalConnectorAttachEvent

sysExternalConnectorDetachEvent

sysNotifyAltInputSystemDisabled

sysNotifyAltInputSystemEnabled

sysNotifyAntennaRaisedEvent

sysNotifyAppServicesEvent

sysNotifyCardInsertedEvent

sysNotifyCardRemovedEvent

sysNotifyDBAddedEvent

sysNotifyDBChangedEvent

sysNotifyDBCreatedEvent

sysNotifyDBDeletedEvent

sysNotifyDBDirtyEvent

sysNotifyDeleteProtectedEvent

sysNotifyDeviceUnlocked

sysNotifyDisplayChangeEvent

sysNotifyEarlyWakeupEvent

sysNotifyForgotPasswordEvent

sysNotifyHostFSInitDone

sysNotifyLateWakeupEvent

sysNotifyLocaleChangedEvent

sysNotifyMenuCmdBarOpenEvent

sysNotifyPhoneEvent

sysNotifyPOSEMountEvent

sysNotifyResetFinishedEvent

sysNotifyRetryEnqueueKey

sysNotifySecuritySettingEvent

sysNotifySleepNotifyEvent

sysNotifySleepRequestEvent

sysNotifySyncFinishEvent

sysNotifySyncStartEvent

sysNotifyTimeChangeEvent

sysNotifyVolumeMountedEvent

sysNotifyVolumeUnmountedEvent

Deprecated Notifications

Notification Manager Functions and Macros

SysNotifyBroadcast

SysNotifyBroadcastDeferred

SysNotifyRegister

SysNotifyRegisterBackground

SysNotifyRegisterV40

SysNotifyUnregister

SysNotifyUnregisterV40

Application-Defined Functions

SysNotifyProcPtr

12 Palm Types

Palm Types Structures and Types

Boolean

coord

Coord

Enum16

Enum8

fcoord_t

MemHandle

MemPtr

ProcPtr

SignedEnum16

SignedEnum8

SysHandle

VAddr

wchar16_t

wchar32_t

Palm Types Constants

Time Constants

Boolean Values

Miscellaneous Constants

Palm Types Functions and Macros

EndianSwap16

EndianSwap32

ErrConvertFrom68k

ErrConvertTo68k

P_MICROSECONDS_TO_NANOSECONDS

P_MILLISECONDS_TO_NANOSECONDS

P_MS2NS

P_NANOSECONDS_TO_MICROSECONDS

P_NANOSECONDS_TO_MILLISECONDS

P_NANOSECONDS_TO_SECONDS

P_NS2MS

P_NS2S

P_NS2US

P_S2NS

P_SECONDS_TO_NANOSECONDS

P_US2NS

RsrcEndianSwap16

RsrcEndianSwap32

13 System Event Manager

System Event Manager Structures and Types

EvtSetAutoOffCmd

System Event Manager Constants

EvtSetAutoOffTag

System Event Manager Functions and Macros

EvtEnableGraffiti

EvtResetAutoOffTimer

EvtSetAutoOffTimer