/pps/services/app-launcher

Object to control the Applications Navigator

Publishers
Applications Navigator; any app
Subscribers
Applications Navigator; any app

Overview

You can control the Applications Navigator by sending commands to the /pps/services/app-launcher PPS object.
Note: The /pps/services/app-launcher object must exist before the Applications Navigator starts.

Command format

Commands sent to the /pps/services/app-launcher object are of the form:

req:json:{"id":ID_number,"cmd":"command_string","app":"app_string,"dat":""}

The ID_number is a unique identifier that will be reflected in the response from the PPS service to your request. You can set the ID to any number you wish.

The dat attribute is responsible for setting parameters that will be sent to the application. Parameters can be either strings or JSON objects.

Launching and stopping applications

At start time, the Applications Navigator publishes a list of existing applications in the PPS object's app_list attribute:

app_list:json:{apps[app_string,app_string],...]}

You can use PPS to launch any application given in app_list. For example, to launch the application named "MediaPlayer", issue the following command:

echo 'req:json:{"id":1,"cmd":"launch app","app":"MediaPlayer","dat":""}' >> /pps/services/app-launcher

To stop the MediaPlayer application, use the "close app" command:

echo 'req:json:{"id":1,"cmd":"close app","app":"MediaPlayer","dat":""}' >> /pps/services/app-launcher

Responses

Each command issued will receive a status response. The status attribute will contain the ID number that you used in your command as well as any errors that may have occurred. For example:

status:json:{"error":"OK","id":1}

This response indicates that the command with ID 1 was executed successfully.

Note:

The Applications Navigator creates the PPS object /pps/system/navigator/command for publishing all necessary data. Applications that subscribe to this object should open it using the ?wait option and delta mode so as to receive all relevant changes.

For more information on ?wait and on delta mode, see "Subscribing" in the Persistent Publish/Subscribe Developer's Guide.