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

Posts: 20
Registered: ‎07-06-2011
My Device: Blackberr 9800,8310,8520,9500
My Carrier: BB Developer

One build for two different versions(4.6,4.7 and 5.0+above) in blackberry



I want to import facebook libraries for blackberry 5.0 and above and don't want to import those libraries for 4.6 and 4.7.

I tried to use preprocessors for 4.7 and above by following below link:




now its working fine with JDE 4.7 but not getting expected result for 5.0.

 Please find the code below which i tried:


//#ifdef JDE_4_7_0
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

public class TestScreen extends MainScreen{


                //#ifdef JDE_4_7_0
                ButtonField btn = new ButtonField("Test Button");
                LabelField lbl1 = new LabelField("Test Label 1");


As per the code i am expecting the result written in else part for 5.0 and if part for 4.7. I checked it on device as well as JDE both.

Please Help.