preference element

Syntax

<preference name="string" value="string" />

Description

The <preference> element defines a preference for the blackberry.app plugin (for example, screen orientation).

Parent elements

<widget>

Child elements

None

Occurrences

Zero or more

Features

To specify a particular feature for your application, use the following associated attributes. In all cases, the name value is case insensitive.

Preference Description
orientation

Specifies the orientation for screens in your app.

The value must specify one of the following strings:
  • default: Specifies that screen orientation changes according to the orientation of the device.
  • portrait: Specifies that screen orientation remains in portrait orientation, regardless of the orientation of the device.
  • landscape: Specifies that screen orientation remains in landscape orientation, regardless of the orientation of the device.

By default, if you do not specify a screen orientation, the orientation is set to default.

Example
<preference name="orientation" value="portrait" />
AutoHideSplashScreen

Hides the splash screen for your application. The value can be "true" or "false", with "true" being the default. When false, the splash screen is displayed until splashscreen.hide() is invoked.

Example
<preference name="AutoHideSplashScreen" value="false" />
backgroundColor

Specifies the background color for your application. The value must specify a color value in the ARGB pixel format using 8 hexadecimal digits.

Example
<preference name="backgroundColor" value="0xffff0000" />
childBrowser

Disables child browser windows. By default, when the content tries to open a resource in a new window or tab (by using window.open(), or by specifying _blank as the target of an anchor), the WebWorks app opens a secondary browser window to display the resource. This feature is enabled by default.

The value must specify a value of "disable".

Example
<preference name="childBrowser" value="disable" />
DiskCache

Enables WebView caching, which prevents the app from issuing multiple network requests for the same resource.

The value can be either "disable" or "enable". The default value is "disable".

Example
<preference name="DiskCache" value="enable" />
HideKeyboardFormAccessoryBar

When enabled, hides the row of buttons (Previous, Next, and Submit) that is displayed by default when an <input> element on the current page of the app gets focus.

The value can be either "disable" or "enable". The default value is "disable".

Example
<preference name="HideKeyboardFormAccessoryBar" value="enable" />
popupBlocker

Enables the popup blocker, which prevents your app from displaying popups. By default, WebWorks apps display popups in a child browser window.

The value attribute must specify a value of "enable".

Example
<preference name="popupBlocker" value="enable" />
websecurity

Disables web security. Disabling web security allows you to access remote content from unknown sources. Before packaging your app for distribution, you should remove this setting unless it is explicitly required.

This feature is intended primarily as a development convenience. In production, all URIs should generally be known and should be whitelisted using the <access> element.

The value attribute must specify a value of "disable".

Example
<preference name="websecurity" value="disable" />

Last modified: 2014-03-10

comments powered by Disqus