Is there a QtWRT quickstart tutorial available/in preparation?



  • As a web developer with LAMP-stack background, I was very happy to see QtWRT announcement yesterday. I have the basic understanding of the idea and roughly know how this is supposed to work. Yet I am struggling a bit with the very first step, which is making my first, simple webapp that I could install and run on my N900 (even if it's plain HTML/CSS with no references to device API whatsoever). I know docs are under development, but is there some sort of step-by-step tutorial for beginners in works as well? That would certainly help people with some web development background to kickstart with some QtWRT development quicker.

    I can see detronizator has wrapped up a jQTouch example into QtWRT package in the other thread: http://developer.qt.nokia.com/forums/viewthread/340/ - his input on how he did that might help a lot.

    Many thanks in advance.



  • Unfortunately, I already thrown away the .wgt that I generated.

    But, making a .wgt is REALLY SIMPLE. It's just a zip file with a different extension.

    The "config.xml" is really the only file you need on the root of that, and it will point to the actual "index.html" that works as the entry point of your widget. Of course, this is the "cut down explaination".

    What you should do is download the source code from http://download.qt.nokia.com/qtwrt/, and search for the 2 examples.

    They are really BASIC examples in terms of UI, but you have a clear example of how to package widgets.

    It's just webpages! Nothing special!

    But, if you want to really dig down and understand how the format of a widget works, and what kind of powerful things you can do, then take a look at the W3C Widgets specifications (Package and Configuration, Widget Interface, DigSig and so forth). Google is really your friend here ;)

    Btw, in the case of jQTouch, I just took one of their examples (the clock thing), packed in a .wgt format, and installed. Qt WRT did the job.



  • Wow, many thanks for quick response! I am seriously surprised how indeed very simple this is - create simple html page, custom config.xml, zip it, change extension and I'm done! :) I'll give it a shot later on.

    In the meantime I'm waiting for full API reference docs, so we know which device capabilities are exposed. If I could suggest something, I'd love to see APIs to access phone registration status (ie. cell status, radio technology, frequency etc.). Let's wait and see. :)



  • I think most of what you ask is part of the current Nokia WRT Service API and will definitely be part of Qt WRT. So you can have high hopes.

    A small hint: when you zip the widget, be sure to have your config.xml in the root of the zip file. So, don't zip a directory with your widget's file in, zip those files directly. See what I mean?

    This is a classical problem that people that start writing widget hit. The only place in which you will find a proper explanation of this is W3C Widgets specs.



  • [quote author="detronizator" date="1280838240"]I think most of what you ask is part of the current Nokia WRT Service API and will definitely be part of Qt WRT. So you can have high hopes.[/quote]

    Sounds promising. :)

    UPDATE:
    While browsing W3C site I came across this: http://lists.w3.org/Archives/Public/public-device-apis/2009Apr/att-0001/sysinfo.html -- looks like this is exactly what I'm looking for. :) Hopefully this API is supported by current QtWRT release! ;)

    [quote]A small hint: when you zip the widget, be sure to have your config.xml in the root of the zip file. So, don't zip a directory with your widget's file in, zip those files directly. See what I mean?[/quote]

    Yep, I get it. Thanks!



  • Is it possible to use a call like this :

    var mySysinfo = nokia.device.load("sysinfo");

    ?



  • [quote author="cesco" date="1282924525"]Is it possible to use a call like this :

    var mySysinfo = nokia.device.load("sysinfo");

    [/quote]

    AFAIR - yes (don't have access to my source code right now).



  • [quote author="evad" date="1282925307"][quote author="cesco" date="1282924525"]Is it possible to use a call like this :

    var mySysinfo = nokia.device.load("sysinfo");

    [/quote]

    AFAIR - yes (don't have access to my source code right now).[/quote]

    where i can find some info about? or a sample?





  • I try this code

    @var mySysinfo = nokia.device.load( "sysinfo");

    var summary;
    // Retrieves a list of supported channels.
    var list = mySysinfo.getChannelList();     
    
    // Displays the supported channels by name and per each supported channel property their
    // name, valid data range and a human readable textual description.       
    for (var descriptor in list) {
        summary += "Channel " + descriptor.name + " has properties:\n";
        for (var name in descriptor.data) {
            summary += name + ": " + descriptor.data[name] + "\n";
        }
    }
    alert(summary);@
    

    But this return all Undefined



  • someone can help me? :) tnx



  • @cesco:

    On your N900 look at /usr/share/wrt/data/widgets_xxx_yyy/lib/nokia/device/sysinfo.js where xxx and yyy are randomly generated strings.

    Alternatively grab the Qt Web Runtime tarball at "http://get.qt.nokia.com/qtwrt ":http://get.qt.nokia.com/qtwrt and see wrt/jsapi/cjse/sysinfo/sysinfo.js.

    sysinfo.js is the JavaScript code that implements the Nokia System Info API. Modifying and improving these JS APIs is as easy as editing the JavaScript wrapper code on the device, so no compilation step is needed if you're feeling adventurous :)



  • [quote author="cesco" date="1282926371"]
    I try this code

    @var mySysinfo = nokia.device.load( "sysinfo");

    var summary;
    // Retrieves a list of supported channels.
    var list = mySysinfo.getChannelList();     
    
    // Displays the supported channels by name and per each supported channel property their
    // name, valid data range and a human readable textual description.       
    for (var descriptor in list) {
        summary += "Channel " + descriptor.name + " has properties:\n";
        for (var name in descriptor.data) {
            summary += name + ": " + descriptor.data[name] + "\n";
        }
    }
    alert(summary);@
    

    But this return all Undefined
    [/quote]

    I have this sorted in one of my samples, ie. I can read all chanells from sysinfo object, yet I only have it at home and I always forget to look it up there. :)



  • @cesco and @evad I am returning all "undefined" as well trying to list out all of the channels in the sysinfo. Any update to cesco's code that is working. I can list all the options for one channel, say like the "Network" channel. I did get that working. Anyhelp with listing all available channels would be nice though. Going to break open the sysinfo.js to see if there is anything in there at lists out the possibilities.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.