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.
OS5 can be pretty tricky. Generally my approach has been a lot of custom logging, avoiding alert, and instead setting up a custom <div> where I update the innerHTML with a log of messages.
Wrapping every function in a try/catch block has also helped narrow down issues for me in conjunction with the logging above.
Beyond that, logging actions as they occur (i.e. "Loading database.", "Database loaded.", "Initializing app.", etc.) to see exactly how far and "what" is executing has also been a big part of my OS5 debugging.
Basically try/catch and logging as much as possible would be my recommendation. Perhaps other members have their own suggestions.
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