Welcome!

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

Reply
Contributor
Posts: 20
Registered: ‎07-06-2011
My Device: Blackberr 9800,8310,8520,9500

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

Hi,

 

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:

 

 http://smartfone-more.blogspot.in/2010/05/coding-for-multiple-blackberry-devices.html

 

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;
//#else
import net.rim.device.api.ui.component.LabelField;
//#endif
import net.rim.device.api.ui.container.MainScreen;


public class TestScreen extends MainScreen{

        TestScreen(){

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

                add(lbl1);
                //#endif
        }
}

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.