Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 13
Registered: ‎09-29-2008
My Device: Not Specified

How do I make application auto-run on startup using ANT?

Hi I wish to make my application to Auto-run on startup. I understand that normally, to have an application run on startup, right-click the project in the BlackBerry JDE and select Properties. Click the Application tab, and check the Auto-run on Startup check box. However, I am using Ant instead of the BlackBerry JDE. Does anyone knows how to make my application to Auto-run on startup? Also, I've heard of using the bb-ant-tools (http://bb-ant-tools.sourceforge.net/) but I'm not exactly how can I use it and allow my application to Auto-run on startup
New Developer
Posts: 9
Registered: ‎10-08-2008
My Device: Not Specified

Re: How do I make application auto-run on startup using ANT?



To create an application using the BlackBerry JDE, you first must create two files, a Workspace (JDW) and a Project (JDP) file. Since the auto-run on startup is a Project setting, the information you're trying to affect will be inside the JDP file. Both these files are plaintext and can be edited with a simple text editor. Or, in your case, created On The Fly.


One of my projects involves doing something along those lines. Because of certain constraints on our application, we have to create a JDP file from three separate pieces: a Prefix (everything up to the list of modules to be compiled), a Suffix (everything after the list of modules to be compiled), and the middle (the list of paths to the modules to be compiled). One of my Ant build targets is a process that creates the JDP file for the main build, and names the file properly - you may need to create a Java-based executable to do the job, but Java's good for that. The Ant RAPC task references the JDW file, which references the JDP file, so make sure that the JDP file you create matches the name and location of the one in the JDW file. Oh, and your JDP-creation task should probably delete any prior version of the JDP file, to make absolutely sure that a new one is being created. Sorry, I'm just paranoid.  :robotvery-happy:It comes with age.


I believe the line in the JDP file you're looking for starts with "RunOnStartup". To be sure, you should create two test projects, one with auto-run set to true, the other with it set to false, and check the differences in the JDP files that get created.