04-10-2012 04:42 PM - edited 04-10-2012 04:45 PM
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?
04-10-2012 10:46 PM
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:
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