Services

This section describes the available application, device, and cloud service methods. Each service is briefly described, repeating some of the information from Chapters 8 and 9, with a listing of the service’s available methods, arguments, and responses.

All services are accessed through:

Mojo.Service.Request(serviceName, {method:methodName, 
parameters:{}, onSuccess:{}, onFailure:{}})

Each service entry includes:

  • The serviceName in the form of a string such as 'palm://com.palm.name'

  • A description of each method, with the methodName and parameters properties

  • The contents of the response object, which is provided as an argument in the callbacks to either the onSuccess or onFailure functions

Accounts

palm://com.palm.accounts/crud

The Accounts service provides an interface for interacting with the accounts system. To use the Synergy applications, you must provide an account ID as a parameter; this service provides access to those IDs.

Many of the methods will use some common objects.

Account

Properties

Type

Description

username

String

Login credentials

domain

String

The account source

accountId

String

The account reference for use in the Synergy applications

icons

Object

Includes largeIcon and smallIcon properties whose values are file paths to the appropriate account icons

dataTypes

Object

A hash of strings indicating which applications apply to this account, either "CONTACTS" or "CALENDAR"

isDataReadOnly

Boolean

If true, data with this account is read-only

Method: listAccounts

Lists accounts created by this application.

Parameters

Type

Description

None

  

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

list

Array

List of account objects

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: createAccount

Creates an account.

Parameters

Type

Description

account

Object

Account object specifying account data

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

accountId

String

The account reference for use accessing the account or for services that are based on the account

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: getAccount

Gets the details of an account.

Parameters

Type

Description

accountId

String

The account reference for use accessing the account or for services that are based on the account

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

account

Object

Account object specifying account data

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: updateAccount

Updates an account with revised data type, icons, or a change to read/write permissions.

Parameters

Type

Description

accountId

String

The account reference for use accessing the account or for services that are based on the account

displayName
StringThe displayable account name
icons

Object

Includes largeIcon and smallIcon properties whose values are file paths to the appropriate account icons

isDataReadOnly

Boolean

If true, data with this account is read-only

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

accountId

String

The account reference for use accessing the account or for services that are based on the account

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: deleteAccount

Deletes account data for one or more data types.

Parameters

Type

Description

accountId

String

The account reference for use accessing the account or for services that are based on the account

dataTypes

Object

A hash of strings indicating which applications apply to this account, either "CONTACTS" or "CALENDAR"

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise there is an error and the account was not created

dataTypes

Object

A hash of strings indicating which data types were deleted

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Alarms

palm://com.palm.power/timeout

The Alarm service is based on the device’s real-time clock (RTC). Alarms are intended to wake applications while minimized, maximized, or to drive polling for Dashboard applications.

Method: set

Sets an alarm to wake up the application.

Parameters

Type

Description

at

String

Create a calendar-based alarm in GMT; of the form: 'mm/dd/yyyy hh:mm:ss'; either at or in is required

in

String

Create a relative alarm; of the form: 'hh:mm:ss', with a minimum alarm of five minutes

uri

String

URI of serviceName/methodName to be called when alarm fires

wakeup

Boolean

Wake up the device from sleep when set to true; set to false by default

params

Object

Parameter object to be sent along with service call; the contents are dependent on the service method defined by the uri parameter

Response

Type

Description

returnValue

Boolean

If true, the alarm was successfully set; otherwise, there is an error and the alarm was not set

key

String

The key provided in the method call

errorText

String

An error message; only provided with returnValue set to false

Method: clear

Clears a previously set alarm.

Parameters

Type

Description

key

String

The key provided in the method call

Response

Type

Description

returnValue

Boolean

If true, the alarm was successfully set; otherwise, there is an error and the alarm was not set

key

String

The key provided in the method call

errorText

String

An error message; only provided with returnValue set to false

Application Manager

palm://com.palm.applicationManager

The Application Manager service provides functions related to finding and launching applications. Applications launched through the Application Manager will open and maximize a new window for the targeted application while minimizing the current application window. This is the general case of specific application services. Currently supported are:

  • Audio

  • Browser

  • Email

  • Maps

  • Messaging

  • Phone

  • Photos

  • Video

For details on calling individual services, refer to the specific service in this section.

Method: open

The Application Manager will use the content type to find the appropriate application to use for that content. Refer to Tables B-1, B-2, and B-3 for the supported content types.

Parameters

Type

Description

target

String

A standard URI format of the form: command://url, where command is one of the supported commands, and the url is an argument string in conventional URL notation; if the command is a webOS application, the url argument string will be specified by that application

Response

Type

Description

None

  

Table B-1. Supported file types

Extension

Mime type

htm

text/html

html

text/html

pdf

application/pdf

txt

application/txt

doc

application/doc

doc

application/msword

xls

appId”:"com.palm.app.docviewer

xls

appId”:"com.palm.app.docviewer

xls

application/vnd.ms-excel

xls

application/x-excel

xls

application/x-msexcel

ppt

application/ppt

ppt

application/mspowerpoint

ppt

application/powerpoint

ppt

application/vnd.ms-powerpoint

ppt

application/x-mspowerpoint

Table B-2. Supported video formats

Extension

Mime type

mp4

video/mp4-generic

mp4

video/quicktime

mp4

video/mp4

mp4

video/mpeg4

m4v

video/mp4-generic

m4v

video/quicktime

m4v

video/mp4

m4v

video/mpeg4

3gp

video/3gp

3gpp

video/3gp

3g2

video/3gpp

3gpp2

video/3gpp

sdp

application/sdp

Table B-3. Supported audio formats

Extension

Mime type

3gp

audio/3gpp

3gpp

audio/3gpp

3ga

audio/3gpp

3gp

audio/3ga

3gpp

audio/3ga

3ga

audio/3ga

3g2

audio/3gpp2

3gp2

audio/3gpp2

sdp

audio/amr

amr

audio/x-amr

mp3

audio/mpa

mp3

audio/mp3

mp3

audio/x-mp3

mp3

audio/x-mpg

mp3

audio/mpeg

mp3

audio/mpeg3

mp3

audio/mpg3

mp3

audio/mpg

mp4

audio/mp4

m4a

audio/mp4

m4a

audio/m4a

aac

audio/aac

aac

audio/x-aac

aac

audio/mpeg

aac

audio/mp4a-latm

wav

audio/wav

pls

audio/x-scpls

m3u

audio/mpegurl

m3u

audio/x-mpegurl

Method: launch

This method will launch a specific application and pass in parameters in the form that the application has specified.

Parameters

Type

Description

id

String

The application ID, defining the intended application

params

Object

JSON object containing the parameters for the target application and specified by the target application

Response

  

None

  

Audio

palm://com.palm.applicationManager

The Audio application can be launched through the Application Manager service.

Method: launch

Launches the Audio application to play or stream the file located at the target URI, downloading it first if not already on the device. If the URI is not specified, it will just launch the audio player to its normal starting scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.streamingmusicplayer'

params

Object

Includes a single property:

  target

String

URL of the form rtsp://audio-file, where audio-file is a well-formed URI targeting an audio file encoded in a supported video format

Response

Type

Description

None

  

Calendar

palm://com.palm.calendar/crud

The Calendar API provides programmatic access to the Calendar application. It allows you to create, read, update, delete, and list calendars, events, and attendees. To use this API you must have an account created via the Accounts API. An account has many calendars, a calendar has many events, and an event has many attendees.

Many of the APIs will use the calendar or event objects as input or output argument.

Calendar

Properties

Type

Description

calendarId

String

Immutable unique identifier for this calendar

name

String

Display name for this calendar

externalId

String

External ID for this calendar

Event

Properties

Type

Description

subject

String

Title of the event

startTimestamp

String

Event start time (in milliseconds UTC)

endTimestamp

String

Event end time (in milliseconds UTC)

allDay

Boolean

True if all-day event

note

String

Optional note text

location

String

Location of the event

alarm

String

ISO 8601 duration format or none, all lowercase

rrule

String

RFC 2445 recurrence string, may only include RRULE, EXRULE, RDATE, or EXDATE

rruleTZ

String

rrule timezone object; this object is mandatory if an rrule is specified

endValidity

String

The end timestamp for nonrecurring events; for recurring events, the end timestamp of last occurrence or 0 if it repeats forever

attendees

Object

Event start time (in milliseconds UTC)

externalId

String

An externalId reference to this event and parented

parentId

String

This is an exception that needs to be linked to a parent recurring series

originalStartTimestamp

Integer

The original start timestamp of this event in the parent series

Note

On methods that accept a calendarId as an input argument (getCalendar, updateCalendar, and deleteCalendar), you can alternately provide an externalId and an accountId.

Method: createCalendar

Creates a new calendar.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

calendar

Object

Specify the name and optionally the externalId

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

calendarId

String

Immutable unique identifier for this calendar

Method: getCalendar

Retrieves the named calendar.

Parameters

Type

Description

calendarId

String

Immutable unique identifier for this calendar

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

calendar

Object

Specify the name and optionally the externalId

Method: updateCalendar

Updates the named calendar.

Parameters

Type

Description

calendar

Object

Specify the name and optionally the externalId

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: deleteCalendar

Deletes the named calendar.

Parameters

Type

Description

calendarId

String

Immutable unique identifier for this calendar

Response

Type

Description

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: listCalendars

Lists all calendars created by the calling application; you will see only the calendars that you have created.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

Response

Type

Description

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

calendars

Array

List of calendar objects associated with this account

Method: createEvent

Adds the provided event to the named calendar.

Parameters

Type

Description

calendarId

String

Immutable unique identifier for this calendar

event

Object

Details of the calendar event

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

eventId

String

Immutable unique identifier for this event

Method: getEvent

Retrieves the details of the named event.

Parameters

Type

Description

eventId

String

Immutable unique identifier for this event

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

event

Object

Details of the calendar event

Method: updateEvent

Updates the event details of the named event.

Parameters

Type

Description

event

Object

Details of the calendar event

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: deleteEvent

Deletes the named event.

Parameters

Type

Description

eventId

String

Immutable unique identifier for this event

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: listEvents

Lists all events created by the calling application; you will only see events in calendars that you have created.

Parameters

Type

Description

calendarId

String

Immutable unique identifier for this calendar

startTimestamp

String

Start of search range (in milliseconds UTC)

endTimestamp

String

End of search range (in milliseconds UTC)

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

events

Array

Array of event objects that fit the search criteria

Method: startTracking

Enables change tracking for an account. After this is called, all user-initiated changes to records belonging to this account will be returned by getChanges. Change tracking is incremental, and changes are forgotten each time doneWithChanges is called.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: getChanges

Gets a list of calendar and event IDs for records in an account that have been changed or deleted by the user since the last time doneWithChanges was called.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

token

String

A string to be passed to doneWithChanges after processing of this change set is complete

calendar

Object

Includes changed, an array of changed calendar objects (calendarId only), and deleted, an array of deleted calendar objects (calendarId and externalId)

events

Object

Includes changed, an array of changed event objects (eventId only), and deleted, an array of deleted event objects (eventId and externalId)

Method: doneWithChanges

Forgets all changes for an account. Future calls to getChanges will return only changes from this point forward.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

token

String

A string to be passed to doneWithChanges after processing of this change set is complete

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Connection Manager

palm://com.palm.connectionmanager

Use the Connection Manager’s getStatus method to get updates on the device connection status.

Method: getStatus

Gets connections status and optionally subscribes to connection notifications.

Parameters

Type

Description

subscribe

Boolean

Set to true for subscriptions, default is false

Response

Type

Description

returnValue

Boolean

If true, the status data was returned and the subscription was set if requested

isInternetConnectionAvailable

Boolean

If true, a data connection is available; could be through any of the transports

wifi

Object

An object with the WiFi status properties:

  state

String

Set to either 'connected' or 'disconnected'

  ipAddress

String

WiFi IP address

  ssid

String

The SSID of the currently connected access point

  bssid

String

The BSSID of the currently connected access point

wan

Object

An object with the WAN status properties:

  state

String

Set to either 'connected' or 'disconnected'

  ipAddress

String

WAN IP address

  network

String

Set to 'unknown', 'unsusable', 'gprs', 'edge', 'umts', 'hsdpa', '1x', 'evdo'

btpan

Object

An object with the Bluetooth PAN status properties:

  state

String

Set to either 'connected' or 'disconnected'

  ipAddress

String

Bluetooth IP address

  panUser

String

Set to the name of the Bluetooth PAN client connected to the device

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Contacts

palm://com.palm.contacts/crud

The Contacts API provides programmatic access to the Contacts application. It allows you to create, read, update, delete, and list contacts entries. To use this API you must have an account created via the Accounts API.

Many of the APIs will use the contacts or contactslice objects as input or output arguments.

Contact

Properties

Type

Description

id

String

Immutable unique identifier for this Contact record

firstName

String

 
lastName

String

 
middleName

String

 
displayText

String

 
prefix

String

 
suffix

String

 
companyName

String

 
jobTitle

String

 
pictureLoc

String

File path to picture location; 50 × 50 pixels rough size

pictureLocSquare

String

File path to picture location; 50 × 50 pixels rough size, but guaranteed to be square

pictureLocBig

String

File path to picture location; a full size image

isAvatarLoc

String

The original start timestamp of this event in the parent series

birthday

String

YYYYMMDD format

anniversary

String

YYYYMMDD format

nickname

String

 
spouse

String

 
children

String

 
notes

String

 
phoneNumbers

Array

Array of phone number strings

emailAddresses

Array

Array of email address strings

imNames

Array

Array of IM names strings

addresses

Array

Array of physical address strings

urls

Array

Array of urls strings

customFields

Array

Array of custom field strings

listPic

String

Input only; the local file path of the picture to use as this contact’s photo in lists; should be square, roughly 50 × 50 pixels

incomingPic

String

Input only; the local file path of the picture to use as this contact’s high-quality photo

extraDetails

String

Generic overflow field for any metadata the third-party application wants to store (will not be displayed in the Contacts application)

Contact Slice

Properties

Type

Description

id

String

Immutable unique identifier for this Contact record

firstName

String

 
lastName

String

 
middleName

String

 
displayText

String

 
prefix

String

 
suffix

String

 
nickname

String

 
companyName

String

 
pictureLoc

String

File path to picture location; 50 × 50 pixels rough size.

pictureLocSquare

String

File path to picture location; 50 × 50 pixels rough size, but guaranteed to be square

Note

On methods that accept an id as an input argument (get, update, and delete), you can alternately provide an externalId and an accountId.

Method: createContact

Adds the provided record to contacts.

Parameters

Type

Description

accountId

String

Immutable unique identifier for this account

contact

Object

The contact to save

externalId

String

External ID for this contact record

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

id

String

Immutable unique identifier for this contact record

Method: getContact

Retrieves the details of the named contact.

Parameters

Type

Description

id

String

Immutable unique identifier for this contact

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

contact

Object

Details of the contact record

Method: updateContact

Updates the event details of the named contact.

Parameters

Type

Description

accountId

String

Immutable unique identifier for this account

contact

Object

The contact to save

id

String

Immutable unique identifier for this contact

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: deleteContact

Deletes the named contact.

Parameters

Type

Description

accountId

String

Immutable unique identifier for this account

id

String

Immutable unique identifier for this contact

trackChanges

Boolean

Marks this change so that it’s tracked, and getChanges will include this record ID in its response; defaults to false

Response

Type

Description

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: listContacts

Lists all contacts created by the calling application; you will see only Contact records that you have created.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

offset

Integer

Start of range

limit

Integer

Number of contacts to return

filter

String

The filter string to search for; matches are done on the firstName, lastName, and companyName fields

Response

Type

Description

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

list

Array

Array of contactslice objects

Method: startTracking

Enables change tracking for an account. After this is called, all user-initiated changes to records belonging to this account will be returned by getChanges. Change tracking is incremental, and changes are forgotten each time doneWithChanges is called.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Method: getChanges

Gets a list of contact IDs for records in an account that have been changed or deleted by the user since the last time doneWithChanges was called.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

token

String

A string to be passed to doneWithChanges after processing of this change set is complete

changed

Array

An array of changed contact record objects (id only)

deleted

Array

An array of deleted contact record objects (id and externalId)

Method: doneWithChanges

Forgets all changes for an account. Future calls to getChanges will only return changes from this point forward.

Parameters

Type

Description

accountId

String

The account reference for use in the Synergy applications

trackerId

String

A client-chosen handle if multiple independent change trackers are needed per account

token

String

A string to be passed to doneWithChanges after processing of this change set is complete

Response

Type

Description

returnValue

Boolean

If true, the account was successfully created; otherwise, there is an error and the account was not created

errorCode

Integer

If returnValue is false, the errorCode provides the error number

errorText

String

An error message; only provided with returnValue set to false

Email

palm://com.palm.applicationManager

The Email application can be launched through the Application Manager service.

Method: open

Launches the Email application to the compose scene, which will be addressed with the provided email address.

Parameters

Type

Description

target

String

A mailto URI formatted as specified in RFC2368

Response

Type

Description

None

  

Method: launch

Launches the Email application to the compose scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.email'

params

Object

Includes a single property:

  summary

String

Text to display in the subject line

  text

String

Text to display in the body of the email message

  recipients

Array

Recipients array, including:

    value

String

A properly formed email address of the recipient

    type

String

Set to email

    role

Integer

Numeric ID for type of recipient where 1=To, 2=CC, and 3=BCC

    contactDisplay

String

Display name for the recipient

  attachments

Array

Array of objects containing the property fullPath (the full path and file name) and the optional properties displayName and mimeType

  accountId

String

The ID of the account from which to send the email message; default account will be used if not provided

Response

Type

Description

None

  

Location Services

palm://com.palm.location

Palm webOS provides basic location services to get single or multiple location fixes.

Method: getCurrentPosition

You can get the current position sourced from the built in GPS, or through Cell ID or WiFi ID, depending on what’s available.

Parameters

Type

Description

accuracy

Integer

Accuracy or precision of the fix: 1 for high precision, 2 for medium (default), and 3 for low

responseTime

Integer

Accuracy or precision of the fix: 1 for less than 5 seconds, 2 for less than 20 seconds (default), and 3 for greater than 20 seconds

maximumAge

Integer

Accept a cached position no older than maximumAge (in seconds); if 0 or not specified, a new fix will always be requested

Response

Type

Description

errorCode

Integer

Status of service request; if errorCode, a successful request and the following response properties will be available; otherwise, errorCode provides an error number to describe the failure

errorText

String

An error message; only provided with returnValue set to false

timestamp

Double

The time (in milliseconds) when the location fix was retrieved

latitude

Double

The latitude of the location in degrees

longitude

Double

The longitude of the location in degrees

horizAccuracy

Double

Horizontal accuracy (in meters) of the location fix

vertAccuracy

Double

Vertical accuracy (in meters) of the location fix

heading

Double

The compass azimuth (in degrees); set to –1 if unknown

velocity

Double

The velocity (in meters/second); set to –1 if unknown

altitude

Double

The altitude (in meters); set to –1 if unknown

Method: startTracking

Requests a continuous GPS fix by invoking the onSuccess callback with a new location object every time the service determines that the position of the device has changed. In case of error, the service will call the callback with error code set to some value greater than 0.

Parameters

Type

Description

subscribe

Boolean

Set to true for subscriptions, default is false

Response

Type

Description

errorCode

Integer

Status of service request; if errorCode, a successful request and the following response properties will be available; otherwise, errorCode provides an error number to describe the failure

errorText

String

An error message; only provided with returnValue set to false

timestamp

Double

The time (in milliseconds) when the location fix was retrieved

latitude

Double

The latitude of the location in degrees

longitude

Double

The longitude of the location in degrees

horizAccuracy

Double

Horizontal accuracy (in meters) of the location fix

vertAccuracy

Double

Vertical accuracy (in meters) of the location fix

heading

Double

The compass azimuth (in degrees); set to −1 if unknown

velocity

Double

The velocity (in meters/second); set to −1 if unknown

altitude

Double

The altitude (in meters); set to −1 if unknown

Method: getReverseLocation

Requests a location for the given latitude and longitude.

Parameters

Type

Description

latitude

Double

The latitude of the location in degrees

longitude

Double

The longitude of the location in degrees

Response

Type

Description

errorCode

Integer

Status of service request; if errorCode, a successful request and the following response properties will be available; otherwise errorCode provides an error number to describe the failure

errorText

String

An error message; only provided with returnValue set to false

address

String

U.S. only, not available in other regions; formatted user-readable address with individual lines separated by a semicolon (;); typically two or three lines

Maps

palm://com.palm.applicationManager

The Maps application can be launched through the Application Manager service.

Method: open

Launches the Maps application to the map scene, which will be loaded from the results of a query if provided.

Parameters

Type

Description

target

String

URL matching the regular expression:

(.+.)?google.(com|[a-z]{2}|com?.[a-z]{2})(/maps/m|/maps/m/.*)

Or alternately, the target string can be of the form mapto:location, where location is a well-formed location

Response

Type

Description

None

  

Method: launch

Launches the Maps application to the map view scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.maps'

params

Object

Includes:

  query

String

Well-formed expression complying with the Google Map Parameters spec; options include address, latitude/longitude, location, and business search or driving directions

  zoom

String

Zoom level: numeric value from 1 to 18, with 18 being max zoom in; max zoom level depends on the region (for some regions, zoom level 18 may not be available)

  location

Object

If specified, map will search for query around this location as described by these properties:

lat = latitude in degrees (float)

lng = longitude in degrees (float)

acc = accuracy in meters; optional (float)

age = age of fix in seconds

  type

String

Sets the display type, currently limited to m for map (default when not set) and k for satellite

  layer

String

Activates selective overlays, currently limited to t for traffic or null for no overlay

Response

Type

Description

None

  

Messaging

palm://com.palm.applicationManager

The Messaging application can be launched through the Application Manager service.

Method: launch

Launches the Messaging application to the chat scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.messaging'

params

Object

Includes:

  personId

String

Contacts ID for the recipient; only apply to the launching the chat view

  contactPointId

String

Contacts entry ID for the contact method (i.e., mobile phone number, IM address); only apply to the launching the chat view; you can optionally pass a contactPointId to set the selected transport when you launch the chat

  messageText

String

The contents of the message

  composeAddress

String

Mobile phone number; an alternative to the personID/contactPointId above; currently only supports one number

  attachment

String

Path to a single attachment file; JPG images only

Response

Type

Description

None

  

Phone

palm://com.palm.applicationManager

The Phone application can be launched through the Application Manager service.

Method: open

Launches the Phone application to the dial scene, prepopulating the dial string if provided.

Parameters

Type

Description

target

String

URL of the from "tel://dialstring", where dialstring is part or all of a phone number; the number can contain pause and wait characters to indicate that DTMF tones should be sent after the call connects

Response

Type

Description

None

  

Method: launch

Launches the Phone application to the dial scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.phone'

Response

Type

Description

None

  

Photos

palm://com.palm.applicationManager

The Photos application can be launched through the Application Manager service.

Method: launch

Launches the Photos application to its album scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.photos'

Response

Type

Description

None

  

System Properties

palm://com.palm.preferences/systemProperties

Applications can request a named system property, currently limited to a unique device ID.

Method: getSysProperties

Requests the named property, which is returned in a response object.

Parameters

Type

Description

key

String

Options: "com.palm.properties.nduid" (device ID)

Response

Type

Description

returnValue

Boolean

If true, the key was retrieved and the value was returned

errorText

String

An error message; only provided with returnValue set to false

System Service

palm://com.palm.systemservice/time

The system is designed to expose a set of services allowing applications to access some general system settings.

Method: getSystemTime

Requests the system time, and if the subscribe property is true, it will receive notifications when the timezone changes and/or the system time changes by a significant amount (currently five minutes).

Parameters

Type

Description

subscribe

Boolean

Set to true for subscriptions, default is false

Response

Type

Description

returnValue

Boolean

If true, the key was retrieved and the value was returned

errorCode

Integer

Status of service request; if errorCode, a successful request and the following response properties will be available; otherwise, errorCode provides an error number to describe the failure

localtime

Integer

The time for the current timezone (in seconds)

offset

Integer

Offset from the UTC (in minutes)

timezone

String

The current system timezone

System Sounds

palm://com.palm.audio/systemsounds

The System Sounds service is used to play audio feedback in response to user interaction, with low latency.

Method: playFeedback

Plays a system sound using the feedback stream class. Intended for UI feedback such as UI button clicks, keypad clicks, and similar sounds. The available sound names are enumerated in Table B-4.

Parameters

Type

Description

name

String

Set to the name of the sound to play (see Table B-4 for a complete list of sound names)

Response

Type

Description

returnValue

Boolean

If true, the key was retrieved and the value was returned

errorCode

Integer

Status of service request; if errorCode, a successful request and the following response properties will be available; otherwise, errorCode provides an error number to describe the failure

errorText

String

An error message; only provided with returnValue set to false

Table B-4. System sounds

Names

appclose

back_01

default_425hz

delete_01

discardingapp_01

down2

dtmf_0

dtmf_1

dtmf_2

dtmf_3

dtmf_4

dtmf_5

dtmf_6

dtmf_7

dtmf_8

dtmf_9

browser_01

card_01

card_02

card_03

card_04

card_05

dtmf_asterisk

dtmf_pound

error_01

error_02

error_03

focusing

launch_01

launch_02

launch_03

pagebacwards

pageforward_01

shuffle_02

shuffle_03

shuffle_04

shuffle_05

shuffle_06

shuffle_07

shuffle_08

shuffling_01

shutter

switchingapps_01

switchingapps_02

switchingapps_03

tones_3beeps_otasp_done

unassigned

up2

Video

palm://com.palm.applicationManager

The Video application can be launched through the Application Manager service.

Method: launch

Launches the Video application to play or stream the file located at the target URI, downloading it first if not already on the device. If a URI is not specified, it will launch the video player to its normal starting scene.

Parameters

Type

Description

id

String

Set to 'com.palm.app.videoplayer'

params

Object

Includes a single property:

  target

String

URL of the form rtsp://video-file, where video-file is a well-formed URI targeting a video file encoded in a supported video format

  videoTitle

String

The name of the video to be displayed to the user

  thumbURL

String

The URL of a thumbnail to be displayed while the video is loading

Response

Type

Description

None

  
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.203.124