Skip to main content

Blackberry build script

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2010-10-29


I created a small blackberry app which I plan to use on both type of bb devices: touch and keyboard.
I'm not using NETBEANS, using eclipse and compile the project using ANT script.

In the implementation factory it set the following:

//#ifdef touch
//# return new com.sun.lwuit.impl.blackberry.BlackBerryTouchImplementation();
return new BlackBerryImplementation();

But when I run the application in any device it's always readh this line: return new BlackBerryImplementation();

What should I define in my ANT script to define "touch" in case of touch screen?

I know I can build two versions one for each type of devices, but I'm looking for generic solution if possible.

Thank you


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2010-03-15

Unless you are programming for a really ancient OS version you can do this:

<div>public LWUITImplementation createImplementation() {</div><div> </div><div>        if (Touchscreen.isSupported()) {</div><div>            return new BlackBerryTouchImplementation();</div><div>        }</div><div> </div><div>        return new BlackBerryImplementation();</div><div>        </div><div>    }</div>

This way you can have one build for either touch-enabled or regular device.