BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 181
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default wtkrapc -> rapc ant task - 02-05-2007, 04:18 AM

Hi,

I'm building a BlackBerry application in Eclipse. Currently I'm using the Antenna wtkrapc build task below, which takes a JAR archive of all the class files, and a JAD file as arguments:

Code:
    
<target name="rapc" description="RIM COD Compiler" depends="package">
        <wtkrapc
            quiet="true"
            midlet="false"
            jadfile="${jadfile}"
            source="${final.jar}"
            codename="${codename}"
            import="${net_rim_api.jar}"
            destdir="output/tocod/"/>
    </target>
The application auto-runs on the BlackBerry, which is achieved by specifying RIM-MIDlet-Flags-1: 3 in the JAD file.

The project has now got to the point where I need to specify an alternate entry point, which is not auto-run and requires a custom icon. As far as I'm aware this cannot be achieved with the wtkrapc task, and I must use the rapc task instead. I've read through this excellent thread: Building without JDE... - BlackBerryForums.com : Your Number One BlackBerry Community but I'm still not sure how I can convert my current wtkrapc task to a rapc task. Where do you specify the input files etc?

Any help would be greatly appreciated!

TIA, Ben
   
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 181
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 02-05-2007, 05:02 AM

I'm also going to need to synchronise the application data with the desktop. The dev guide talks about setting 'arguments passed field to init' using the JDE. How can this be done using ant?

Thanks again, Ben
   
  (#3 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 181
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default Progress! - 02-05-2007, 09:53 AM

I've now managed to convert the wtkrapc task to a rapc task:

Code:
		<rapc jdehome="${jdehome}">
			<workspace src="BB.jdw" build="true" update="true">
				<cldc src="cldc_project.jdp" title="${codename}" vendor="Telnic" version="0.1" description="Application For BlackBerry OS" arguments="" systemmodule="true" runonstartup="true" startuptier="7" output="${codename}" options="-quiet" update="true" build="true">
					<files dir=".">
						<include name="src/**/*.*" />
					</files>
				</cldc>

			</workspace>
		</rapc>
Now I need to add the alternate entry point. I know I can use the cldcentrypoint tag, but how do I specify which class to use as the alternate entry point?

Ben
   
  (#4 (permalink)) Old
Skipper_Joe Offline
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Posts: 237
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Default 02-06-2007, 09:53 AM

As far as I know, you can't have 2 entry points (main() methods) in 1 BlackBerry application.
However you can check in your main method if application is called on startup. I didn't try it myself yet, but I found next code snippet in blackberrytools project:

Code:
public static void main(String[] args) {

        try {
            // If we are starting up then register our replyto menu items
            // otherwise we should display the BBReply configuration screen
            if (ApplicationManager.getApplicationManager().inStartup()) {
                registerMenuItem();
                CorrectorStringPattern stringPattern = new CorrectorStringPattern();
                StringPatternRepository.addPattern(stringPattern);
                RuntimeStore.getRuntimeStore().put(CorrectorActiveFieldCookie.ID,
                                                   new CorrectorActiveFieldCookieFactory());
            } else {
                System.out.println("*** Start BBCorrector GUI application");
                BBCorrector bbcorrector = new BBCorrector();
                bbcorrector.enterEventDispatcher();
            }
        } catch (Exception e) {
            System.out.println("*** Error: " + e.getMessage());
        }

    }
see SourceForge.net Repository - [blackberrytools] View of /bbcorrector/src/org/bbcorrector/BBCorrector.java
   
  (#5 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 181
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 02-06-2007, 11:47 AM

The JDE allows you to specify alternate entry points.

Basically what I have is a main application that I want to run at startup, that adds menus to the address book.

I also want an Icon to launch the application separately from the menu items. Therefore I have one class with a main that registers the menu items, and one that launches an application.

I could have two COD files, but the classes are shared, so it seems a waste of space. It's also a pain to have to install two COD files, when essentially there is one application.
   
  (#6 (permalink)) Old
Skipper_Joe Offline
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Posts: 237
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Default 02-06-2007, 12:45 PM

Hi, Ben!

Can you describe how you can define alternate entry points in JDE? I find "alternate entry point" dropdown in Project Properties, but it is always disabled and I don't know how to use it.

I think solution which I proposed above, works for your needs. main() method in provided code snippet works in both cases: when user runs application clicking icon on Home screen and when device starts up.
ApplicationManager.inStartup() method allows to differentiate these 2 cases in runtime and implement different behavior for each cases.

I just tried it myself - it works for me.

Andrey
   
  (#7 (permalink)) Old
bdowling Offline
Thumbs Must Hurt
 
Posts: 181
Join Date: Jan 2007
Model: 8800
Carrier: Orange
Default 02-07-2007, 05:23 AM

Hi Andrey,

I have no idea how you specify the alternate entry point in the JDE (I'm using eclipse), but I have read about it in the BlackBerry docs. I may have misunderstood the purpose of it.

I gave the sample code a go and it didn't work for me at first. After I changed my application from a system module to a non-system module it worked perfectly though!!

Thanks, Ben
   
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.