Академический Документы
Профессиональный Документы
Культура Документы
Version: 2.5
Development Guide
SWD-1218770-1202050647-001
Contents
1 Developing BlackBerry WebWorks applications and web pages......................................................................................... 2
Create a BlackBerry web application project.............................................................................................................................. 2
Create a BlackBerry WebWorks application project.................................................................................................................... 2
Securing BlackBerry WebWorks applications.............................................................................................................................. 2
Allowing access to external resources and APIs................................................................................................................. 3
Update the configuration document for a BlackBerry WebWorks application........................................................................ 3
Configuration document for a BlackBerry WebWorks application................................................................................... 3
Specifying permissions for BlackBerry WebWorks applications........................................................................................ 8
Using JavaScript extensions with BlackBerry WebWorks applications..................................................................................... 9
Add a JavaScript extension................................................................................................................................................... 9
Signing .cod files for BlackBerry WebWorks applications.......................................................................................................... 9
Obtain and install signing keys............................................................................................................................................ 10
Compiling BlackBerry WebWorks applications............................................................................................................................ 10
Specify the build parameters................................................................................................................................................ 10
Build and sign a BlackBerry WebWorks application........................................................................................................... 11
5 Glossary......................................................................................................................................................................................... 16
6 Provide feedback......................................................................................................................................................................... 17
7 Legal notice.................................................................................................................................................................................. 18
Development Guide Developing BlackBerry WebWorks applications and web pages
2
Development Guide Update the configuration document for a BlackBerry WebWorks application
Information
The Information section specifies general information about the BlackBerry® WebWorks™ application, and the entry points for
the application.
Name
The Name property specifies a human-readable name for a BlackBerry® WebWorks™ application that you can use, for example,
in an application menu.
This property is required. If you do not specify a name, the application is not valid.
3
Development Guide Update the configuration document for a BlackBerry WebWorks application
Description
The description property specifies a human-readable description of the BlackBerry® WebWorks™ application.
Version
The version property specifies a valid version number for the BlackBerry® WebWorks™ application, in one of the following formats:
• x.x
• x.x.x
• x.x.x.x
This element is required. If you specify an invalid version number, the application is not valid.
Entry Points
The Entry Points property specifies the foreground and background start pages that the BlackBerry® WebWorks™ application
uses when it starts. You can specify files that are outside of the BlackBerry WebWorks application archive by specifying a URL
for the location of each file. You must specify at least one entry point.
The Allow Parameters on Command Line Invoke check box enables you to pass parameters when the application runs from
another application. For example, you can send a query string to include in the page URI when your application runs.
The foreground start page runs when you start the application from an icon. The background start page runs in the background
when the BlackBerry device starts or when you install the application on the device. You cannot access the background page
from an icon.
You can specify one or both entry points. If you only specify a foreground page, then the application runs when you click the
application icon. If you only specify a background page (such as a listener application), then the application runs when you start
the device or install the application, and is not visible to the device user.
Loading Screen
The Loading Screen section specifies the properties, effects, and images for the screen that appears when the BlackBerry®
WebWorks™ application starts.
Images and colors
The images and colors properties define the images and colors for your BlackBerry® WebWorks™ application.
Property Description
Foreground image The foreground image property specifies an image to display on the loading
screen. The image is centered on the loading screen.
Background image The background image property specifies an image to display in the
background on the loading screen. The image is scaled to fit the entire
screen.
4
Development Guide Update the configuration document for a BlackBerry WebWorks application
Property Description
Background color The background color property specifies the color of the background on the
loading screen.
Cache Configuration
The Cache Configuration section enables caching for the BlackBerry® WebWorks™ application and specifies the limits for the
total cache and for individual items. When you change cache settings, data usage might increase beyond the minimum required
for the application. Make sure you understand the implications of changing these settings for a particular application.
Regardless of the cache settings that you configure, the following are never cached:
• HTTPS requests
• Authenticated HTTP requests
• Any request method other than GET
• Failed requests (with a response code other than 200)
You can use the following HTTP headers with application caching:
• pragma: no-cache
• expires
• cache-control: no-cache
• cache-control: no-store
• cache-control: private
• cache-control: max-age
• date
• content-length
Application caching ignores any other HTTP headers.
5
Development Guide Update the configuration document for a BlackBerry WebWorks application
Property Description
Disable caching The Disable caching check box disables caching for the application.
Maximum total cache size This limit specifies the maximum cache size for the application. Any items
that exceed the maximum cache size are not cached.
Maximum individual item size This limit specifies the maximum cache size for items within the
application. The No limit radio button eliminates the limit.
If cache directives are not specified in HTTP This limit specifies the amount of time to retain the cache, if directives are
headers not specified in the HTTP headers. The Do not cache radio button specifies
that items without directives are not cached.
Permissions
The Permissions properties specify the domains and features to which the BlackBerry® WebWorks™ application requires access.
Author
The Author section of the configuration document specifies the information for the author of the BlackBerry® WebWorks™
application.
Property Description
Author The author property specifies the author of the application.
Web address The web address property specifies a URL, for example, the web page for the
author of the application.
Email The email property specifies an email address for the author of the application.
Copyright The copyright property specifies a copyright statement for the application.
License
The License section specifies the text and URL for a license agreement for the BlackBerry® WebWorks™ application.
Property Description
License agreement The License agreement property contains the text for the end user license for
the application.
License URL The License URL property specifies a link for a URL that provides information
about the license agreement.
6
Development Guide Update the configuration document for a BlackBerry WebWorks application
Configuration
The Configuration section specifies the icons, header information, focus-based navigation, and Back button behavior for the
BlackBerry® WebWorks™ application.
Icons
You define the icon and hover icon for your BlackBerry® WebWorks™ application in the Configuration section of the configuration
document.
Property Description
Icon The icon is the image that appears on the BlackBerry device for your
application in its regular state, when it is not selected.
The file name for the default icon is either image.gif, image.png, or
image.jpg. The file name is not case sensitive.
Hover icon The hover icon is the image that appears on the device for your application
when it receives focus, when it is selected.
If you do not specify a hover icon in the configuration document, the icon
that you specify for the icon appears, regardless of the application icon state.
Custom header
The custom header property specifies a header value that is added to every request for data that the BlackBerry® WebWorks™
application sends. This header value enables you to distinguish application requests from BlackBerry® Browser requests.
Use focus-based navigation
By default, a BlackBerry® WebWorks™ application does not allow focus-based navigation. When you enable focus-based
navigation, BlackBerry device users can use the trackpad or trackball to give focus to an element on the screen of a BlackBerry
device.
Override the Back button
By default, when a BlackBerry® device user clicks the Back button, the previous page displays.
You can override the default behavior for the Back button by specifying that when a user clicks the Back button, the BlackBerry®
WebWorks™ application closes.
Connection
The Connection section specifies the order and timeout for network transports.
7
Development Guide
Property Description
Override the default connection order and timeout This property specifies the order in which you want the
BlackBerry® device to attempt to make a connection. The
default order for the connection manager appears in the
configuration document.
HTTP connection timeout When the device attempts to make a connection to a particular
transport, the timeout attribute specifies the timeout, in
milliseconds.
8
Development Guide Using JavaScript extensions with BlackBerry WebWorks applications
9
Development Guide Compiling BlackBerry WebWorks applications
If you install a registration key before you install the BlackBerry WebWorks Packager, you should create an unsigned .cod file for
an application and then sign the .cod file in the same way that you requested the registration key.
Option Description
Import existing signing keys a. Click Import Existing Keys.
b. Navigate to a .csi file and click OK.
Install new signing keys a. Click Install New Keys.
b. Navigate to a .csi file and click OK.
c. When prompted, provide the PIN provided by RIM and a
password of at least eight characters.
Remove signing keys a. Click Remove Keys.
b. Navigate to a .csi file and click OK.
4. To automatically sign .cod files when you package an application, click the Automatically sign the cod files after
packaging check box.
5. To run the Signature Tool in the background, click the Run Signature Tool in background check box.
10
Development Guide Compiling BlackBerry WebWorks applications
Task Steps
Exclude files from the build. a. Click Add Filter.
b. Type a file extension that you want to exclude from the build.
c. Click OK.
Remove filters for the excluded files. a. Click a file extension.
b. Click Remove Filter.
Change the folder for the build output. a. Beside the Output folder field, click Browse.
b. Navigate to the new output folder and click OK.
4. Click OK.
Task Steps
Build a BlackBerry WebWorks application project. Click Build BlackBerry WebWorks Project.
Build and sign a BlackBerry WebWorks application project. a. Click Build and Sign BlackBerry WebWorks Project.
b. Type the password that you specified when you installed the
registry key.
11
Development Guide Debugging BlackBerry WebWorks applications and web pages
1. In the Project Explorer, if a project exists, right-click a project. Click Debug As > BlackBerry Simulator.
2. In the Project Explorer, if no project exists, on the Run menu, click Debug configurations.
3. In the left pane, double-click BlackBerry Web.
4. Click the Url Configurations tab.
12
Development Guide View the profiling data for project resources
5. Type the URL of the website to open in the BlackBerry Smartphone Simulator.
6. Click Apply.
7. Click Close.
13
Development Guide Testing BlackBerry WebWorks applications
In the Package Explorer, right-click a BlackBerry WebWorks application or web project. Click Run As > BlackBerry
Simulator.
14
Development Guide Making BlackBerry WebWorks applications available to BlackBerry device users
15
Development Guide Glossary
Glossary 5
AJAX
Asynchronous JavaScript® and XML
API
application programming interface
HTTP
Hypertext Transfer Protocol
HTTPS
Hypertext Transfer Protocol over Secure Sockets Layer
JSP
JavaServer® Pages
MDS
Mobile Data System
MIME
Multipurpose Internet Mail Extensions
PIN
personal identification number
TCP
Transmission Control Protocol
WAP
Wireless Application Protocol
XHTML
Extensible Hypertext Markup Language
XML
Extensible Markup Language
16
Development Guide Provide feedback
Provide feedback 6
To provide feedback on this deliverable, visit www.blackberry.com/docsfeedback.
17
Development Guide Legal notice
Legal notice 7
©2010 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, and related trademarks, names,
and logos are the property of Research In Motion Limited and are registered and/or used in the U.S. and countries around the
world.
ActiveX and Microsoft are trademarks of Microsoft Corporation. Eclipse is a trademark of Eclipse Foundation, Inc. Java, JavaScript,
and JavaServer are trademarks of Oracle America, Inc. All other trademarks are the property of their respective owners.
This documentation including all documentation incorporated by reference herein such as documentation provided or made
available at www.blackberry.com/go/docs is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition,
endorsement, guarantee, representation, or warranty of any kind by Research In Motion Limited and its affiliated companies
("RIM") and RIM assumes no responsibility for any typographical, technical, or other inaccuracies, errors, or omissions in this
documentation. In order to protect RIM proprietary and confidential information and/or trade secrets, this documentation may
describe some aspects of RIM technology in generalized terms. RIM reserves the right to periodically change information that
is contained in this documentation; however, RIM makes no commitment to provide any such changes, updates, enhancements,
or other additions to this documentation to you in a timely manner or at all.
This documentation might contain references to third-party sources of information, hardware or software, products or services
including components and content such as content protected by copyright and/or third-party web sites (collectively the "Third
Party Products and Services"). RIM does not control, and is not responsible for, any Third Party Products and Services including,
without limitation the content, accuracy, copyright compliance, compatibility, performance, trustworthiness, legality, decency,
links, or any other aspect of Third Party Products and Services. The inclusion of a reference to Third Party Products and Services
in this documentation does not imply endorsement by RIM of the Third Party Products and Services or the third party in any way.
EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION, ALL CONDITIONS,
ENDORSEMENTS, GUARANTEES, REPRESENTATIONS, OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
WITHOUT LIMITATION, ANY CONDITIONS, ENDORSEMENTS, GUARANTEES, REPRESENTATIONS OR WARRANTIES OF
DURABILITY, FITNESS FOR A PARTICULAR PURPOSE OR USE, MERCHANTABILITY, MERCHANTABLE QUALITY, NON-
INFRINGEMENT, SATISFACTORY QUALITY, OR TITLE, OR ARISING FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING
OR USAGE OF TRADE, OR RELATED TO THE DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-PERFORMANCE
OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED HEREIN, ARE
HEREBY EXCLUDED. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE. SOME JURISDICTIONS
MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. TO THE EXTENT
PERMITTED BY LAW, ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT
THEY CANNOT BE EXCLUDED AS SET OUT ABOVE, BUT CAN BE LIMITED, ARE HEREBY LIMITED TO NINETY (90) DAYS FROM
THE DATE YOU FIRST ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, IN NO EVENT SHALL RIM BE LIABLE
FOR ANY TYPE OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-
PERFORMANCE OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND SERVICES REFERENCED
HEREIN INCLUDING WITHOUT LIMITATION ANY OF THE FOLLOWING DAMAGES: DIRECT, CONSEQUENTIAL, EXEMPLARY,
INCIDENTAL, INDIRECT, SPECIAL, PUNITIVE, OR AGGRAVATED DAMAGES, DAMAGES FOR LOSS OF PROFITS OR REVENUES,
FAILURE TO REALIZE ANY EXPECTED SAVINGS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, LOSS OF
BUSINESS OPPORTUNITY, OR CORRUPTION OR LOSS OF DATA, FAILURES TO TRANSMIT OR RECEIVE ANY DATA, PROBLEMS
18
Development Guide Legal notice
ASSOCIATED WITH ANY APPLICATIONS USED IN CONJUNCTION WITH RIM PRODUCTS OR SERVICES, DOWNTIME COSTS,
LOSS OF THE USE OF RIM PRODUCTS OR SERVICES OR ANY PORTION THEREOF OR OF ANY AIRTIME SERVICES, COST OF
SUBSTITUTE GOODS, COSTS OF COVER, FACILITIES OR SERVICES, COST OF CAPITAL, OR OTHER SIMILAR PECUNIARY
LOSSES, WHETHER OR NOT SUCH DAMAGES WERE FORESEEN OR UNFORESEEN, AND EVEN IF RIM HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, RIM SHALL HAVE NO OTHER
OBLIGATION, DUTY, OR LIABILITY WHATSOEVER IN CONTRACT, TORT, OR OTHERWISE TO YOU INCLUDING ANY LIABILITY
FOR NEGLIGENCE OR STRICT LIABILITY.
THE LIMITATIONS, EXCLUSIONS, AND DISCLAIMERS HEREIN SHALL APPLY: (A) IRRESPECTIVE OF THE NATURE OF THE
CAUSE OF ACTION, DEMAND, OR ACTION BY YOU INCLUDING BUT NOT LIMITED TO BREACH OF CONTRACT, NEGLIGENCE,
TORT, STRICT LIABILITY OR ANY OTHER LEGAL THEORY AND SHALL SURVIVE A FUNDAMENTAL BREACH OR BREACHES
OR THE FAILURE OF THE ESSENTIAL PURPOSE OF THIS AGREEMENT OR OF ANY REMEDY CONTAINED HEREIN; AND (B)
TO RIM AND ITS AFFILIATED COMPANIES, THEIR SUCCESSORS, ASSIGNS, AGENTS, SUPPLIERS (INCLUDING AIRTIME
SERVICE PROVIDERS), AUTHORIZED RIM DISTRIBUTORS (ALSO INCLUDING AIRTIME SERVICE PROVIDERS) AND THEIR
RESPECTIVE DIRECTORS, EMPLOYEES, AND INDEPENDENT CONTRACTORS.
IN ADDITION TO THE LIMITATIONS AND EXCLUSIONS SET OUT ABOVE, IN NO EVENT SHALL ANY DIRECTOR, EMPLOYEE,
AGENT, DISTRIBUTOR, SUPPLIER, INDEPENDENT CONTRACTOR OF RIM OR ANY AFFILIATES OF RIM HAVE ANY LIABILITY
ARISING FROM OR RELATED TO THE DOCUMENTATION.
Prior to subscribing for, installing, or using any Third Party Products and Services, it is your responsibility to ensure that your
airtime service provider has agreed to support all of their features. Some airtime service providers might not offer Internet browsing
functionality with a subscription to the BlackBerry® Internet Service. Check with your service provider for availability, roaming
arrangements, service plans and features. Installation or use of Third Party Products and Services with RIM's products and services
may require one or more patent, trademark, copyright, or other licenses in order to avoid infringement or violation of third party
rights. You are solely responsible for determining whether to use Third Party Products and Services and if any third party licenses
are required to do so. If required you are responsible for acquiring them. You should not install or use Third Party Products and
Services until all necessary licenses have been acquired. Any Third Party Products and Services that are provided with RIM's
products and services are provided as a convenience to you and are provided "AS IS" with no express or implied conditions,
endorsements, guarantees, representations, or warranties of any kind by RIM and RIM assumes no liability whatsoever, in relation
thereto. Your use of Third Party Products and Services shall be governed by and subject to you agreeing to the terms of separate
licenses and other agreements applicable thereto with third parties, except to the extent expressly covered by a license or other
agreement with RIM.
Certain features outlined in this documentation require a minimum version of BlackBerry® Enterprise Server, BlackBerry® Desktop
Software, and/or BlackBerry® Device Software.
The terms of use of any RIM product or service are set out in a separate license or other agreement with RIM applicable thereto.
NOTHING IN THIS DOCUMENTATION IS INTENDED TO SUPERSEDE ANY EXPRESS WRITTEN AGREEMENTS OR WARRANTIES
PROVIDED BY RIM FOR PORTIONS OF ANY RIM PRODUCT OR SERVICE OTHER THAN THIS DOCUMENTATION.
19
Development Guide Legal notice
Published in Canada
20