Web Runtime Q&As
From Symbian Developer Community
| Stub This is a stub page. You are encouraged to extend/expand it as discussed in Document Creation Workflow. |
This article is intended to serve as an FAQ guide for those
- new to Web Runtime but familiar with the Symbian platform
- familiar with Web Runtime but new to Symbian
Please help us fill out this page by posting your favourite question and answer pairs here.
Contents |
What is a Widget?
In a similar way to Apple’s OS X Dashboard widgets, Google Gadgets, or Opera widgets, a widget for a Symbian device can be installed directly to the handset to provide access to Internet services without opening the Web browser.
Widgets run in the Web Runtime (WRT) environment, which is supported by devices based on S60 3rd Edition, Feature Pack 2 and later. Since widgets are based on standard Web technologies, so you can develop them using the same tools that you would use to create Web content. Widgets are an ideal way for Web designers and developers to extend their products and services into the mobile space.
Widgets are mainly implemented using Web standards such as XHTML, Cascading Style Sheets (CSS) and the JavaScript scripting language. The WRT environment supports JavaScript APIs that conform to the ECMA-262 3rd Edition specification. WRT also supports the JavaScript DOM (Document Object Model) and XMLHttpRequest objects. In addition to the standard JavaScript objects, WRT provides widget-specific extension APIs that allow widgets to access system properties and services and the mobile environment.
What is WRT?
Web Runtime (WRT) was created by extending the powerful core of the Webkit Web browser for S60. It is an open-source engine that allows developers to use familiar industry standards such as HTML, Cascading Style Sheets (CSS) and Asynchronous JavaScript and XML (AJAX).
What is WRTKit?
WRTKit is a library of JavaScript code, CSS style rules and graphical elements that help you to implement sophisticated, customizable, "application-like" user interfaces for your WRT Widgets, with just a few lines of JavaScript code.
The WRTKit automatically generates HTML and CSS to:
- Handle both pointer-based and tab-based interaction modes so that you can choose the one that fits your widget best.
- Provide consistent hover and focus behaviour throughout the user interface.
- Support different screen sizes, screen resizes and rotations.
- Enable consistent User interface controls like buttons, checkboxes and scrollbars.
WRTKit is comprehensively documented within Aptana Studio; there are other useful examples in the Nokia WRT Effort
You can add the WRTKit folder to your Nokia Web Runtime (WRT) projects using the Aptana File | New | Project wizard - or you can simply copy the folder from other WRTKit based widget projects.
Is Web Runtime open source
Yes! Web Runtime is available under EPL from Symbian Mercurial repository.
Where can I find example code?
The Symbian^1 SDK (aka Symbian/S60 5th edition) provides a dozen or so examples. They are organized like a collection of little recipes (ie, send a message, get location information, accessing to the calendar/contacts, etc)
The Aptana IDE provides a few templates to seed your projects. These include an RSS reader and a Flickr application.
A growing number of examples is available in Symbian's Mercurial repository here. Please contribute your examples here!
How can I place a call?
Symbian/S60's Web Runtime has a rich set of javascript extensions called Platform Services: contacts, calendar, location, logging, media, messaging, etc. Nice but how does one make a call. It is a phone after all. Turns out there is the well known tel URI protocol. The syntax is simply tel:<number>. This can be used directly in an href or in javascript.
var url = "tel:123-123-1234"; widget.openURL(url);
Here 123-123-1234 represents a generic phone number.
What are the limitations of WRT?
The WRT API 1.0 provides UI access from web application. Symbian^1 is based on WRT API 1.1 which provides a
platform services API for many mobile services but there are limits. While this entry isn't complete and will change over time, here is a list of some limitations.
- Access to the file system is limited. You can save preferences via widget.setPreferenceForKey().
- Integration with other applications on the phone is limited. You can launch them with openApplication().
How does one deploy a widget via a website?
When downloading a file via a browser, we need to give the browser a hint about what to do with it via a MIME type. If this is not provided, the file is simply saved to the filesystem. The Web Developer's Library tells us that...
"Specify the MIME type of the widget installation package in the HTTP response header. The MIME type must be application/x-nokia-widget. The following is an example of how to define the widget MIME type for an Apache server configuration file: AddType x-nokia-widget .wgz"
The w3c is in the process of standardizing widgets. According to the w3c standard for widget packaging and configuration [1] the MIME type is application/widget. At some point, I expect a future version of WRT to migrate to this standard.
Comments
Sign in to comment…


