feature element

Supported platforms

  • yes BlackBerry OS: 5.0 - 7.0
  • yes BlackBerry PlayBook OS: 2.0+
  • yes BlackBerry 10 OS

Syntax

<feature id="string" 
         required=["true" | "false"]
         version="string" />

Description

The <feature> element specifies a BlackBerry feature that a BlackBerry WebWorks application can use; the feature can be a particular BlackBerry API or an option to enable a feature or functionality (for example, enabling the Adobe Flash plug-in to render Flash content).

You can use the <feature> element within the <access> element to access a feature under the external domain. You can also use the <feature> element at the root of the configuration document, before any <access> elements, for access to the local web page.

If you do not specify an <access> element above the <feature> element, the local domain is used. If you do not specify an API, the application cannot use the API for the specified domain.

Parent elements

<widget>, <access>

Child elements

  • BlackBerry 10 OS: <param>
  • BlackBerry OS and BlackBerry PlayBook OS: None

Occurrences

Zero or more

Attributes

You can use the following attributes in this element:

Attribute Description
id The id attribute can specify:
  • The name of the BlackBerry API. The value must match the name of the API, but is not case sensitive. You cannot use a wildcard (*) to use multiple namespaces at the same time.
  • An option to enable the Flash plug-in to render Flash content in your BlackBerry 10 application. This feature is available only in the BlackBerry 10 OS. By default, the Flash plug-in is disabled.

    To enable the Flash plug-in, set the id to enable-flash. You must make the <feature id="enable-flash"> element a child of the <widget> element; it cannot be a child of the <access> element.

The id attribute is required for all platforms.

required

The required attribute is provided to conform to the W3C specification.

This attribute is optional.

version

The version attribute specifies the library version of the API.

This attribute is optional.

Examples: Specifying feature access

For BlackBerry 10 OS:

<feature id="blackberry.ui.dialog" required="true" version="1.0.0.0"/>
<feature id="enable-flash"/>
<access uri="http://www.somedomain.com" subdomains="true">
    <feature id="blackberry.app" required="true" version="1.0.0"/>
    <feature id="blackberry.invoke" required="true" version="1.0.0"/>
</access>

For BlackBerry PlayBook OS:

<feature id="blackberry.ui.dialog" required="true" version="1.0.0"/>
<access uri="http://www.somedomain.com" subdomains="true">
   <feature id="blackberry.app.event" required="true" version="1.0.0"/>
   <feature id="blackberry.invoke" required="true" version="1.0.0"/>
</access>

For BlackBerry 7 and earlier:

<feature id="blackberry.ui.dialog" required="true" version="1.0.0"/>
<access uri="http://www.somedomain.com" subdomains="true">
   <feature id="blackberry.pim.memo" required="true" version="1.0.0"/>
   <feature id="blackberry.invoke.MemoArguments" required="true" version="1.0.0"/>
</access>

Last modified: 2013-05-02