Skip to main content

Blackberry build script

1 reply [Last post]
stern23
Offline
Joined: 2010-10-29
Points: 0

Hello,

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();
//#else
return new BlackBerryImplementation();
//#endif

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

Stern

Reply viewing options

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

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.