How to Create Simple W3C Widget

Here are instructions how you can create a simple W3C widget that runs on Qt Web Runtime (WRT) e.g. on Nokia N900.

Widgets are just ZIP packages containing at least two files: Configuration file (config.xml) and resource files (index.html and other HTML, CSS, JavaScript and image files).

  • widget.wgt – zip archive renamed to *.wgt, containing:

    • config.xml - configurations
    • index.html - content

Configuration file contains information about the widget like name, version, author, icon etc. Example of simple config.xml file:

<?xml version="1.0" ?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://www.substanceofcode.com/hellowidget" version="0.1.0">
  <!-- Name of the widget -->
  <name>Hello World</name>
  <!-- Description is shown when installing widget -->
  <description>Simple hello world widget</description>
  <!-- Start page for widget -->
  <content src="index.html" />
  <!-- Default icon for widget -->
  <icon src="icon.png" />
  <!-- Widget author -->
  <author>Tommi Laukkanen</author>
</widget>

Content is good old HTML, CSS, JavaScript etc. files. For example simple HTML page like this:

<html>
  <head>
    <title>Hello!</title>
  </head>
  <body>
    <h1>Hello W3C Widget World!</h1>
  </body>
</html>

When these two files are packaged into a ZIP archive and renamed to Hello.wgt you can install it on your Nokia N900 just by clicking the file in file browser. When you run the app it’ll look something like this:

Hello World W3C Widget

Widget running on Nokia N900 with Qt Web Runtime

I hope that you find this tutorial helpful and start crafting your own widgets!

  • Lucas

    Great, never image that creating apps for n900 would be so easy.

  • http://www.facebook.com/demludi Borislav Stoilkov

     Hi, PLEASE HELP ME .I used your config.xml file to create my app but when i change the version from 0.1 to 0.2 i cant update.( then first i must remove manualy the wgt file and reinstall the new version.What is wrong ???

  • http://www.facebook.com/demludi Borislav Stoilkov

     Hi, PLEASE HELP ME .I used your
    config.xml file to create my app but when i change the version from 0.1
    to 0.2 i cant update.( then first i must remove manualy the wgt file and
    reinstall the new version.What is wrong ???