WebOS smell on S60 or Nokia WRT Widgets

    STEWFor a very long time I ignored the Web Technologies section of the Nokia forum, thinking that it describes the techniques for creating web pages for mobile phones. As it turned out - in vain. Behind it was a description of the WRT platform (Web RunTime), a very convenient tool for a web developer to write simple mobile programs called widgets.

    The widget is essentially a regular web page, but for the user it looks like a separate standalone program, indistinguishable from traditional applications. To use and write widgets, symbian certification is not required, they are zip archives, but they are installed automatically, like other S60 applications

    At the moment, widgets are supported by phones on the S60 3rd FP 2 and S60 5th platforms (a replenished list of phones with widget support can be found here ), and widgets are also supported by some S60 devices from other manufacturers.

    Because The latest models of S60 phones have a built-in browser based on WebKit, you can count on all the features of this engine.
    Nokia has announced support for the following technologies:
    • HTML 4.01
    • XHTML Mobile Profiles
    • CSS Level 2 revision 1 (CSS 2.1), WAP CSS
    • JavaScript 1.5 (ECMA-262 3rd Edition)
    • Dom
    • Ajax

    Widgets also use Flash Lite 3, but for some reason it has not yet been declared as officially supported by the Nokia Library.
    The functionality of widgets is not limited to the capabilities of the built-in browser. Nokia has expanded classic JavaScript to provide access to the following features:

    WRT 1.0+

    • Widget data storage (similar to cookies that are not available, most often used for settings)
    • Change and assignment of functions to buttons in the application menu (soft keys)
    • Phone System and Status Information
    • Key backlight and vibration function

    WRT 1.1+

    • Access to information about installed applications, their launch
    • Access Calendar Information
    • Address Book Access
    • Access to navigation
    • Access to information about calls made (Log)
    • Access to information about files in the gallery (but there is no access to the files themselves)
    • Receive and send messages
    • Accelerometer access

    Widgets do not have access to the camera, Bluetooth, WiFi control and the file system - for security reasons and because of their focus. However, there is a technique for using a web server application (which, by the way, is written in python) to access the necessary information through it, via HTTP.
    As already mentioned, the widget is a zip archive (with the WGZ extension), the contents of which differ from a regular web page only in the presence of an XML description file. For familiarization, you can pick any ready-made widget, for example STEW ( widget itself , description ).

    twitwianFor the development of complex widgets it makes sense to put the SDK, it has support for reporting JavaScript errors, a log, and working with the emulator during development is more convenient. For debugging widgets, you can use any JS debugger, the same FireBug (although it is more logical to use webkit-enabled debuggers), but you need to adapt the script if it has a phone-specific code. For example, first replace such a code with a compatible one with classic browsers, or create objects that will emulate phone-specific functions.

    So far, not everything is as rosy as it seems at first glance. There is some “dampness” of the platform, and some offensive little things, for example, the impossibility of working in the background (excluding the still obscure widgets for the main screen), a noticeable delay between clicking on the element and the widget's reaction, glitches with the execution of some JS events (onkeyup, onkeydown, onchange), problems with virtual keyboards. At the same time, it pleases that the platform is developing and being finalized, new sections in the documentation appear.

    Mana links and examples (English)
    Widgets web developer library at forum.nokia.com (Landing Pad)
    Information about widgets on nokia wiki + examples

    Also popular now: