Auto Run Applications on Blackberry

A lot of documentation exists on having a Application auto start when the device starts. Having the ability to run some code during device start up is essential if you need to register or setup your application to handle events on the device. 

Most of the existing documentation indicates that you should add a second project to your workspace in Eclipse and then define a "Alternate Entry Point" this would allow you to specify a start up parameter to the main function so you can determine if the application is starting because of device boot up or because the user invoked it. 

Well as far as I can not tell this method is no longer supported when you install the latest BlackBerry SDK ontop of Eclipse. The method I've now got working and to be honest seems far more robust is to simply have your application "Auto-run on startup" and then detect the status of the handset in your main function. This article here tells you exactly how to detect this. 

I hope this method works out for you if your trying to do the same, there are thousands of post on how to do the alternate entry point method and only limited information on how to do it this way. 

Also make sure you don't enter the GUI event dispatcher during device startup or you'll get some unpredictable results. 

Note: I'm using Eclipse 3.5.2 and the 1.1 SDK from RIM. Targeting  4.6 to 5.0 Blackberry OS.