Plug-in API Summary

The PDK introduces several device-specific API calls. See Palm PDK Library for instructions on using these calls, and for more information on their data types.

For more information on OpenGL and its API, see the OpenGL site. The PDK currently supports OpenGL ES 1.1 and 2.0. For more information on SDL and its API, see the SDL library home page.

The following API calls provide device-specific functionality when developing a PDK-based application.

In this section:


General APIs

Call Summary Description
PDL_BannerMessagesEnable Enables or disables banner messages.
PDL_CustomPauseUiEnable Enables or disables system UI for handling app reactivation.
PDL_EnableCompass Activates or deactivates device compass.
PDL_EnableLocationTracking Activates or deactivates location tracking on the device.
PDL_GesturesEnable Enables or disables gesture area actions.
PDL_GetAppinfoValue Gets a value from the appinfo.json file.
PDL_GetCallingPath Gets the app's full path minus the app name.
PDL_GetCompass Gets the compass bearing for magnetic and true north.
PDL_GetDataFilePath Gets a location for saving app data.
PDL_GetDeviceName Gets the device name.
PDL_GetError Returns a null terminated string containing information about the last internal PDL error.
PDL_GetHardware DEPRECATED. Use PDL_GetHardwareID.
PDL_GetHardwareID Returns a constant for the current device the app is running on. These values are defined in PDL_types.h.
PDL_GetKeyName Gets the name of a passed key.
PDL_GetLanguage Gets the device's configured language and country.
PDL_GetLocation Gets the device's current location.
PDL_GetNetInfo Gets information about a network interface.
PDL_GetOSVersion Returns the device's webOS version.
PDL_GetPDKVersion Returns the PDK version.
PDL_GetRegionCountryCode Returns the device's two-letter country/region code.
PDL_GetRegionCountryName Returns the device's country/region name.
PDL_GetScreenMetrics Returns the device's screen metrics.
PDL_GetUniqueID Gets the device's unique ID.
PDL_Init Initialize a PDK app.
PDL_isAppLicensedForDevice Allows Plug-in apps to check if the app has been licensed for the device.
PDL_IsPlugin Indicates if app is a standalone application or a plug-in component for a JavaScript application.
PDL_LaunchBrowser Launches a web browser with a passed URL.
PDL_LaunchEmail Launches an email browser with passed subject and body fields.
PDL_LaunchEmailTo Launches the email app with pre-defined (subject, value, recipients) values for a to-be-sent email.
PDL_LoadOGL Dynamically open a specific OpenGL version.
PDL_Log Writes output to /media/internal/tracking.txt as per specified format.
PDL_Minimize Cards (minimizes) the app at runtime.
PDL_NotifyMusicPlaying Notifies other apps your app is playing music.
PDL_Quit Shuts down the PDL.
PDL_ScreenTimeoutEnable Enables or disables screen dimming for a fullscreen app.
PDL_SetAutomaticSoundPausing Enables or disables automatic sound pausing when carded.
PDL_SetFirewallPortStatus Opens a port on the firewall.
PDL_SetKeyboardState Summon or dismiss the on-screen keyboard for the HP TouchPad.
PDL_SetOrientation Sets orientation for pop-up alerts and banner messages.
PDL_SetTouchAggression Allows Plug-in apps to set the device's touch aggression.
PDL_Vibrate Vibrates the device.
PDLNet_Get_Info Deprecated. See PDL_GetNetInfo.


APIs for Calling Plug-in Functions

The following API calls allow JavaScript (JS) apps to call Plug-in app functions (see JavaScript and Plug-in Interface for more information).

Call Summary Description
PDL_CallJS In a combined JS/Plug-in app, allows the Plug-in component to call a JS function.
PDL_GetJSFunctionName Returns the name of the function that was called (from the JS side) which caused this handler to be called.
PDL_GetJSParamDouble Parses and returns a double value passed in a string from a JavaScript app invocation of a Plug-in app function.
PDL_GetJSParamInt Parses and returns an int value passed in a string from a JavaScript app invocation of a Plug-in app function.
PDL_GetJSParamString Parses and returns a string value passed from a JavaScript app invocation of a Plug-in app function.
PDL_GetNumJSParams Returns the number of parameters passed from a JavaScript app invocation of a Plug-in app function.
PDL_HandleJSCalls Calls the handlers for any pending downstream JS calls in the queue.
PDL_IsPoller Returns true if a polling handler is handling params or false if they are being handled immediately.
PDL_JSException From a Plug-in app function, throws an exception back to the calling JavaScript.
PDL_JSRegistrationComplete Ends registration of Plug-in app functions that a JavaScript app can invoke.
PDL_JSReply In a Plug-in app function, returns a string value to the calling JavaScript app.
PDL_RegisterJSHandler Register a Plug-in app function that a JavaScript app can invoke.
PDL_RegisterPollingJSHandler Same as PDL_RegisterJSHandler, but instead of the JS handler being called immediately, the request is put in a queue, and an event is posted to SDL to alert you.


APIs for Accessing Services

The following API calls allow Plug-in apps to call device services with or without a callback response function.

Call Summary Description
PDL_GetParamBool Extracts a named boolean parameter passed to a service callback function.
PDL_GetParamDouble Extracts a named double parameter passed to a service callback function.
PDL_GetParamInt Extracts a named int parameter passed to a service callback function.
PDL_GetParamJson Extracts parameters passed to a service callback function and returns them as a JSON-formatted string.
PDL_GetParamString Extracts a named string parameter passed to a service callback function.
PDL_ParamExists Checks if a named parameter has been passed to a service callback function.
PDL_ServiceCall Calls a device service without a callback response.
PDL_ServiceCallWithCallback Calls a device service with a callback response function.
PDL_UnregisterServiceCallback

Stops a service from sending any more responses using a callback function.


Video APIs

The PDK comes with the following calls for playing video on the device. See SDL_cinema for instructions on using these calls and their data types.

Note:

SDL_cinema calls cannot be used on the desktop or in hybrid apps. They can only be used in full-screen PDK apps.

Call Summary Description
CIN_Init Initializes SDL cinema.
CIN_LoadCIN Loads a cinema from a URL.
CIN_Play Start cinema playback.
CIN_Pause Pauses cinema playback.
CIN_Stop Stops cinema playback.
CIN_DeInit Deinitializes SDL cinema.


In-App Payment APIs

Call Summary Description
PDL_FreeItemCollection Frees a PDL_ItemCollection struct.
PDL_FreeItemInfo Frees a PDL_ItemInfo struct.
PDL_FreeItemReceipt Frees a PDL_ItemReceipt struct.
PDL_GetAvailableItems Returns a list of all items available to this application.
PDL_GetItemCollectionJSON Returns a JSON formatted string for the values contained in a PDL_ItemCollection struct.
PDL_GetItemInfo Returns information about a specific purchase item.
PDL_GetItemJSON Returns a JSON formatted string for the values contained in a PDL_ItemInfo struct.
PDL_GetItemReceiptJSON Returns a JSON formatted string for the values contained in a PDL_ItemReceipt struct.
PDL_GetPendingPurchaseInfo Gets information about a pending purchase.
PDL_PurchaseItem Purchases an in-app item.