Code sample: Creating a BlackBerry WebWorks configuration document

The valid file name for a configuration document for a BlackBerry® WebWorks™ application is config.xml, and is case insensitive. Within the application archive, the configuration document must use this file name. The config.xml file must exist in the root folder of the application archive.

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns=" http://www.w3.org/ns/widgets"
        xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="2.0"
        rim:header="RIM-Widget: rim/widget">

  <author href="http://www.example.com/" rim:copyright="Copyright 1998-2011 My Corp">My Corp</author>
  <rim:navigation mode="focus" />
  <name> The example application</name>

  <description>
    A sample application to demonstrate some of the possibilities.
  </description>

  <rim:loadingScreen backgroundImage="background.png"
                     foregroundImage="foreground.gif"
                     onLocalPageLoad="true">
        <rim:transitionEffect type="zoomIn" />
  </rim:loadingScreen>

  <icon src="icons/example.png"/>
  <icon src="icons/boo.png" rim:hover="true"/>

		<rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" />

  <content src="index.html" >
    <rim:background src="listener.html" runOnStartup="true" />
  </content>

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

  <rim:connection timeout="25000">
    <id>TCP_WIFI</id>
    <id>MDS</id>
    <id>BIS-B</id>
    <id>TCP_CELLULAR</id>
    <id>WAP2</id>
    <id>WAP</id>
  </rim:connection>

  <license>
    Example license
    Copyright (c) 2008 My Corp.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
    BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    ACTION OF CONTRACT, INSULT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.

  </license>

</widget>

Was this information helpful? Send us your comments.