Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
04-27-2014 03:10 PM
In a recent BB10 update I noticed that if an app doesn't completely initialize within 5-6 seconds this logs appears:
forensics_logworthy_state: Error attaching 2, No such file or directory, bailing
And the app appears to crash.
It took a while to figure out it wasn't the code but how long the code was running - which is the root of my problem. My app has asubstantial amount of initialization work to do, question is when and where is the best place to do this time consuming work?
I initialially though I had to let the event loop start and I'd be safe but no, that wasn't the case, crash still happened.
Do I have to run this initialization process in another thread? Is it unwise to run this much work in the UI context?
Devs, how do you initialize your non-UI app portions?
Solved! Go to Solution.
04-27-2014 04:36 PM
I think you've already given yourself your answer but yes run it in another thread.
Time consuming processes should be asynchronous and run using one of the threading methods such as QThread or QtConcurrent...
04-28-2014 09:32 AM
It's a good idea to try and minimize as much as possible the amount of work that needs to be done when your app first launches. Users expect an app to be in a usable state within a two seconds in order to feel snappy.
A good general approach is to only do exactly what you need to display the first screen. Use things like ComponentDelegates in QML to prevent the entire application flow from having to be loaded into memory at launch. Defer network calls until the app is already started. Follow the approach outlined here: http://supportforums.blackberry.com/t5/Native-Deve
I could offer more specific suggestions if you can provide an overview of what your app is actually doing at start up.