Block Screen Orientation in Rhodes App for Blackberry

This tip show how to block the screen orientation to specific direction in Rhodes Application for blackberry.

To block the Screen Orientation in blackberry, navigate to the path < Rodes >/platform/bb/rhodes/src/rhomobile/

Now open the RhodesApplication.java and paste this function inside the class ( RhodesApplication ).

 private void setScreenOrientation(int iDirection){
int thisDirections;
switch(iDirection) 
{
case Display.DIRECTION_LANDSCAPE:
thisDirections = Display.DIRECTION_LANDSCAPE;
break;
case Display.DIRECTION_PORTRAIT:
thisDirections = Display.DIRECTION_PORTRAIT;
break;
case Display.DIRECTION_NORTH:
thisDirections = Display.DIRECTION_NORTH;
break;
case Display.DIRECTION_EAST:
thisDirections = Display.DIRECTION_EAST;
break;
case Display.DIRECTION_WEST:
thisDirections = Display.DIRECTION_WEST;
break;
default:
thisDirections = -1;
break;
}
 
if( thisDirections != -1 )
Ui.getUiEngineInstance().setAcceptableDirections(thisDirections);
 
}
 
 
Now call this function inside the main() with the help of object of the class. 
 
         _instance = new RhodesApplication();
LOG.INFO_EVENT( "RhodesApplication created" );
_instance.setScreenOrientation( Display.DIRECTION_NORTH );        // calling  the setScreenOrientation() here.
_instance.enterEventDispatcher();
150 150 Burnignorance | Where Minds Meet And Sparks Fly!