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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Developer
songdawg
Posts: 59
Registered: ‎06-08-2011
My Carrier: n/a

Best practices for building Webworks apps

[ Edited ]

I know this is a general question but I would love to hear from anyone who feels like sharing. On https://bdsc.webapps.blackberry.com there is mention of UI guidelines but I don't see any around memory use, network, error handling, logging, data storage etc.

 

Any links, tips or advice?

Please use plain text.
BlackBerry Development Advisor
oros
Posts: 839
Registered: ‎04-12-2010
My Carrier: Bell

Re: Best practices for building Webworks apps

Hello there,

 

I think my best recommendation would be to wrap the contents of every function in try/catch blocks and leverage console.log to keep track of any messages in the Web Inspector console. It has saved me a lot of heartache.

 

I also like to make gratuitous use of JSLint. I do my development in Notepad++ and there is a JSLint plugin you can add which will allow you to execute JavaScript validation on an HTML or JS file that you currently have open. It's a great way to keep your code clean, and it will also catch a lot of the syntactical errors.

 

Of course, everyone will have their own preferred methods, but those up there make up the majority of my personal debugging arsenal.

 

We have a few guides on leveraging Web Inspector for debugging an application. The most comprehensive is probably here:

https://bdsc.webapps.blackberry.com/html5/documentation/ww_testing/web_inspector_overview_1553586_11...

 

Note that this is mostly for the analysis of your application, not necessarily best practices per se.

 

Data storage depends a lot on the particular use case you are looking at. I would recommend checking out the Data Storage and IO API references here:

https://bdsc.webapps.blackberry.com/html5/api

 

Erik Oros

BlackBerry Development Advisor

Please note that I will be unavailable between May 19th and June 4th. Sincere apologies for any delays during this time. I will do my best to follow-up as soon as I am able.

Erik Oros
BlackBerry Development Advisor
@WaterlooErik
Please use plain text.