Tuesday, May 19, 2009

What's a minimal widget?

Hello,

I like to understanding what is required for a minimal application. Not only does one understand what is required but you learn to appreciated the functionality provided by what is optional. Let's consider a minimal Symbian/S60 widget. It is composed of two files info.plist and an html file.

info.plist is an xml file containing key value pairs. It must define the application name, an identifier and the html file. Here is a example.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/NOKIA_COM_1/DTDs/plist-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayName</key>
<string>Kilroy</string>
<key>Identifier</key>
<string>org.symbian.widget.kilroy</string>
<key>MainHTML</key>
<string>Main.html</string>
</dict>
</plist>

The only constraint on the html file is the name. We just defined it in the info.plist file. Here is a trivial html file which must be named Main.html.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Kilroy</title>
</head>
<body id="body">
The sky is so beautiful. I can bite my toes.
</body>
</html>

Deploying is pretty simple:
  1. Assuming these two files are in there own directory, we can simply zip it up. Users of the Windows Explorer and Send To a compressed folder.
  2. Rename the file extension from zip to wgz.
  3. send it over to the phone. I used Nokia's PC Suite.

Now let's turn our attention to the phone. This minimal widget will show up on the phone like any other application. Launch the application which we called kilroy. Not too exciting. You should see a white screen displaying the text from the html file. Developer's will appreciate that no signing was involved. User's will appreciate not having to entry a URL on the phone and that it is ease to launch the application.

-jk

0 comments: