Bondi Widget porting example - standard Javascript
Article Metadata
Reasons: hamishwillee (28 Nov 2011)
The test widget package on which this depends is no longer available (/bondi.webvm.net/test.wgt). This needs to be relocated or the article needs to be updated to work off a new base widget.
Contents |
Preface
This is an example of porting a Bondi Widget to Nokia WRT using the guide found here. The example widget does not use Bondi API functions, only standard Javascript. The widget demonstrates different methods of passing variables to another HTML-page.
1. Download the .wgt package
The Test widget wgt package can be found by following this link:2. Rename and unzip the Test widget archive
The archive needs to be unzipped to make modifications to its contents. First rename the file extension from *.wgt to *.zip. Then extract the zip archive.
3. Create info.plist manifest file
When installing a .wgz file the system looks for a manifest file called info.plist. The Bondi Widget equivalent is called config.xml.
Here's how to use the Bondi Widget config.xml data to create the WRT manifest file:
- Download and unzip this info.plist template file and save it in the widget's root directory.
- Open the widget's config.xml file and find the <name> element. Copy the text found within the element and paste it into the <string> element under <key>DisplayName</key> element of the info.plist file.
<key>DisplayName</key>
<string>Test widget</string> - The identifier of a Bondi widget can be found in the id attribute of the <widget> element in config.xml. If the value is a URL, use the conventional WRT identifier form, which is the URL in reverse. Add the identifier to <string> element under <key>Identifier</key> element of the info.plist file.
<key>Identifier</key>
<string>net.webvm.bondi.test</string> - The HTML-file has not been specified in this Bondi widget. In this case, it searches for index.html by default.
<key>MainHTML</key>
<string>index.html</string> - This widget does not require network access so it can be set to false.
<key>AllowNetworkAccess</key>
<false /> - Save the file.
4. Packaging
Re-zip the containing Test widget folder and change the file extension from *.zip to *.wgz.
5. Deploy
Upload the widget to your mobile device and install. Here is an example of the ported widget. Remember to change the extension to .wgz before installing.

