# Exhibition

A new capability in webOS 2.0 is Exhibition, which allows the device to display information in a special format when it is attached to the Touchstone charging dock. When a device is turned on and charging on the Touchstone, Exhibition mode can be activated by touching the Exhibition icon in the notification area. This mode is similar to a "screen saver" on your desktop.

Placing the device on the Touchstone activates the system's Exhibition application, which in turn launches the default Exhibition app. Two examples included in webOS 2.0 are the Photos app and the Clock app.

If the Photos app is set as the default Exhibition app, it runs a slide show of the device's photos. If the Clock app is displayed, the current time time will be displayed in the user's choice of styles.

## Using Exhibition

When placing the device on the Touchstone for the first time, the Exhibition icon will be displayed in the notification area. Touching the icon will bring up an explanatory notification. Exhibition will be activated automatically after a few seconds, or by touching the notification. The first time Exhibition is used, the Clock app will be the default.

Note that removing the device from the charger does not automatically return to the home screen unless it is to answer a call. This is to allow the user to interact with Exhibition applications should they choose to remove the device from the charger. For example, if an interesting picture comes up in the slide show, and the user picks up the device to get a closer look, the user wants the picture to remain on the screen.

To access Exhibition settings, tap on the settings icon in the bottom left corner.

This will display all the apps currently available for dockmode. If your app is not listed, tap on the plus icon to add it (See the section on JSON on how to active dockmode in your app). Then drag and drop your app to the first position to make it the default app.

## JSON

To make your app available to be launched in dockmode you simply add the following to your app's `appinfo.json` file:

>     "dockMode": true

That’s it! Your app is now available for selection in the dockmode app. If your app is set as the default, it will now run as if it were launched when the device goes into dockmode.

## JavaScript

Running in Exhibition mode allows your app to look or do something different from when it is run normally. This could be as simple as changing the CSS class used to give your app a different look. Your app can detect Exhibition mode from the launch params in the `handleLaunch` method in your app's `AppAssistant`--`params.dockMode` will be true.

>     AppAssistant.prototype.handleLaunch = function(params) {
>       if (params) {
>           if(params.dockMode){ //launch the touchstone theme}
>       }
>     }

## App Lifetime Considerations

When the device goes out of Exhibition mode, your app will continue to run in the background, just like a standard app that is "carded." It will continue to run indefinitely until requested to shutdown to free up memory. Your app will need to take this into account by going into a "background mode"--stop any running animations and either cease or decrease the frequency of periodic updates.

It is also good practice to provide `stageDeactivate` code to provide for an orderly shutdown.

## Sample App

The exhibitionSample App contains a complete application demonstrating this mode. This simple app has a red background when running in standard mode, and a green background when in Exhibition mode.