Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 49
Registered: ‎02-09-2011
My Device: Not Specified

HowTo: Debug in BlackBerry WebWorks for Tablet VM

Aloha, I was going to make this apart of my overall writeup for jQuery mobile / jQuery on the BlackBerry Tablet but since I've seen some posts about "how can I debug within the tablet", I thought I'd get this part out sooner.

 

Step 1:

add the following to your config.xml

 

 

<access subdomains="true" uri="https://getfirebug.com"/>

 

 

Step 2:

Add the following to your index.html or whatever you have set as your main html file.

 

 

<script src="https://getfirebug.com/firebug-lite.js">
{
    startInNewWindow: false,
    startOpened: true,
    enableTrace: true
}
</script>

 

Step 3:

In your javascript code use console.log(); to dump data to the console, you can also see when errors loading scripts show up. this will also show you xhr data and the like in the net tab.

 

some other things you can do with this tool:

 

instead of loading in new code, zipping, creating package and uploading use the javascript console to pull data from local:/// or a remote server directly into your application.

 

you can refresh your application by running window.location.reload(); instead of closing the application.

 

you can test uncertain functionality with the api before writing a ton of code beforehand.

 

you can dump localStorage to make sure data is being stored correctly.

 

These are a few things you can do with this tool, but overall it can be very useful for debugging your application directly on the tablet vm.

 

 

Levi De Haan // Sr. Programmer/Sys. Admin 
1-877-578-3794 x 1000
@levidehaan
1-877-JQUERY-HELP
1-303-747-6007

 

 

 

 

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: HowTo: Debug in BlackBerry WebWorks for Tablet VM

Awesome tips Levi!  Thanks for sharing with the community

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 49
Registered: ‎02-09-2011
My Device: Not Specified

Re: HowTo: Debug in BlackBerry WebWorks for Tablet VM

Of course not a problem :smileyhappy:

 

I have also been seeing some questions about jQuery and jQuery Mobile, specifically jQuery 1.5.1 update, there was a patch pushed through to fix the bug with local:/// and response 0 but from what i've heard 1.5.1 isnt working.

 

If anyone wants to use the above debugging method and post the results here that would be great in helping me get a solution to the issue so 1.5.1 can be used.

 

 

New Developer
Posts: 6
Registered: ‎12-11-2008
My Device: Not Specified

Re: HowTo: Debug in BlackBerry WebWorks for Tablet VM

I have tried this and I can see the firebug debugger at the bottom, I can also choose the javascript that I want from the scripts - but I am not able to see the contents of the script at the bottom pane, to be able to add debug statement.

 

When I access the same from the desktop browser, firebug displays the contents of the script as expected. However, I am unable to set the debug breakpoint even in the desktop browser.

 

Is there anything else I need to do to be able to set debug points? (For PlayBook I have added the access permission in config.xml).

 

Thanks!

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: HowTo: Debug in BlackBerry WebWorks for Tablet VM

JavaScript breakpoints and debugging will not be able to work in this toolkit.  This must be built directly into the browser.  

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter