<widget>

Syntax:

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="string" 
        id="string"
        xml:lang="string"
        rim:header="string"
        rim:userAgent="string">
</widget>

Description:

The <widget> element is the root element of the config.xml file. The config.xml file must contain a single instance of <widget>.

Occurrences:

One.

Parent elements:

None.

Child elements:

Name Occurrences

<access>

zero or more

<author>

one

<content>

one

<description>

zero or more

<license>

one or none

<name>

one

<platform>

zero or more

<preference>

zero or more

Content:

None.

Attributes:

You can define the following attributes for this element:

Attribute Description

xmlns

Required. Defines the namespace for the BlackBerry WebWorks app. The value must be xmlns="http://www.w3.org/ns/widgets". If this namespace is missing, the app archive is not valid.

xmlns:rim

Required. Defines the namespace for the BlackBerry WebWorks extensions (that is, those elements with the rim: prefix). The value must be xmlns:rim="http://www.blackberry.com/ns/widgets".

version

Required. Specifies a valid version for the app, in one of the following formats:

  • x.x.x
  • x.x.x.x

If you specify a version number that is not valid, the app archive is not valid.

rim:header

Optional. Specifies an HTTP header value that precedes every request for data that the app sends. This attribute allows you to distinguish between requests sent from your BlackBerry WebWorks app and requests coming from the BlackBerry Browser. The attribute value can be any string.

rim:userAgent

Optional. Specifies the value for the user agent. The value that you specify is sent as the value of the User-Agent header, which is included with every HTTP request. You can use this string to identify requests coming from your app. The attribute value can be any string.

id

Required. Specifies a unique identifier for the app.

Unless you are repackaging an app from another platform, you should use a reverse DNS format for all platforms, for example, id="com.somedomain.HelloWorld".

If you resubmit an app to BlackBerry World that was initially packaged using a previous version of the BlackBerry WebWorks SDK, the value you specify for this attribute must be the same as the value for the Package-Name in your existing app's .bar MANIFEST file (for example, sampleApp6d5d8d2973ab439a52d274dffa2b018). You can access the MANIFEST file by unzipping the .bar file and viewing it in any text editor.

xml:lang

Optional. Specifies the language that is used in the element. For more information about this attribute, visit www.w3.org/TR/html401/struct/dirlang.html.

Example:

<widget xmlns="http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="2.0.0.0" 
        id="sampleapp"
        rim:header="RIM-Widget:rim/widget"
        rim:userAgent="BlackBerry10/MyWebWorksApp">
</widget>

Last modified: 2014-10-09



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus