Document Viewers

Applications can view common office files from the /media partition by using the Application Manager's open method and by specifying a target URI that points to a file encoded in a supported file format. Several common office file formats are supported. For a full list of file formats, see Resource Types.

Note: If the file is already on the device, the appropriate document viewer launches with the specified file. Otherwise, the file first downloads to the /media partition before launching the appropriate viewer. You can view only the files in the /media/internal partition.

Method

This section describes the following method:

  • open

open

View the file located at the target URI, downloading it first if not already on the device.

Required parameter:

  • target

Parameters

Parameter Type Description
target string URL of the from "://", where filename is a well-formed URI targeting a file encoded in a supported format, designated by either the HTTP header or the ext.

Return Handling

There are no attributes for return handling.

Example

this.controller.serviceRequest('palm://com.palm.applicationManager', {
  method: 'open',
  parameters: {
      target: "http://www.palm.com/us/support/handbooks/800W_Sprint_Datasheet.pdf"
  }
});

this.controller.serviceRequest('palm://com.palm.applicationManager', {
  method: 'open',
  parameters: {
      target: Mojo.appPath + 'documents/Welcome_to_webOS_development.doc'
  }
});   

Sample Code

See Services Sample.