Results 1 to 8 of 8
  1.    #1  
    Hi. I've just started porting my application from the iPhone to WebOS. I love the environment in general. Just one question... How do I debug this puppy?

    I spent 2 days trying to get some basic stuff working and it was all due to a missing comma in the sources.json

    I haven't even gotten to the hard code yet!

    Is there console output I'm missing? Is there a debug switch somewhere? How should I be finding these things. I'm pretty sure the framework must have thrown an exception somewhere when it loaded sources.json but I didn't see anything.

    Thanks!!!
  2. #2  
    What I do, is the basic "print" method to help narrow down error locations in the code. I use the jsjsjs $call$ Mojo.Log.error("here I am") at different locations in my code to help narrow down the problem areas. This text string is written to the /var/log/messages file on the emulator and I monitor contents of this file from a Putty connection to the emulator from my PC. In the Putty terminal screen I use the Linux command tail -f /var/log/messages to see a constant stream of what is being written to the messages file.

    Unfortunately, the Eclipse IDE that I use for Palm Pre development doesn't have much error checking for coding typos. I've spend a lot of time tracking down simple errors like not capitalizing certain letters for system function names or missing semi-colons, etc.
    cohoman

    Palm Apps:

    jVault and jChecklist
  3. #3  
    for the same result as tailing the log, you can use log com.mydomain.myapp via the putty connection (with your app specifics in place of com.mydomain.myapp).
  4. #4  
    You can use the log or actually do command line debugging with breakpoints, steps, etc.

    However, for simple intra-scene debugging, you could just place a div with an id and write your debug output to it.


    For example,

    In your scene html.
    <div id="txtDebug"></div>

    In your assistant.
    $('txtDebug').InnerHTML = "Some debu code " + strSomeDebugVar;

    This clearly has limitations, but it can be useful. It is especially helpful when having others test your app. In those cases, you can add a key command to show or hide the debug div. That way, you can have your testers display it and take a screenshot when they run into an error.
  5. #5  
    Is there a way of making the JSJSJS $interpretor$ $on$ $the$ $phone$ $more$ $descriptive$ $when$ $a$ $statement$/$variable$ $is$ $wrong$? $Like$ $a$ $strict$ $mode$ $in$ $Perl$ ($gives$ $you$ $errors$ $if$ $you$ $use$ $undeclared$ $varables$). $Right$ $now$ $it$ $bails$ $out$ $in$ $the$ $erroneous$ $statement$ $with$ $no$ $error$ $message$ $if$ $I$ $for$ $example$ $mismatch$ $the$ $parentheses$.
  6. #6  
    You might try using the JSLint feature in Templarian's Komodo add-on. It can help find some coding errors.

    http://forums.precentral.net/web-os-...ompletion.html
  7. #7  
    actually, Templarian's komodo edit with put red squigglies under any line that isn't valid javascript.
  8. #8  
    ^That's not me, that's Komodo.

    Quote Originally Posted by Blubble View Post
    You might try using the JSLint feature in Templarian's Komodo add-on. It can help find some coding errors.

    http://forums.precentral.net/web-os-...ompletion.html
    I don't parse .json files though (other than framework_config.json and appinfo.json).

    That is a good suggestion though I'll see if I can write a parser into the next update to double check the sources.json for errors.
    Last edited by Templarian; 09/15/2009 at 02:32 PM.

Posting Permissions