views:

287

answers:

1

Hi, i develop application for Blackberry. In Storm 1 (4.7) and Storm 2 (5.0) i need to disable accelerometer in my application. I want my application does not react to the accelerometer, but that does not affect other applications. Its possible?

+4  A: 

There is no way to disable accelerometer but you can lock screen orientation change:

// To force portrait view in a BlackBerry API application,
// use code like this before invoking UiApplication.pushScreen()
int directions = Display.DIRECTION_NORTH | Display.DIRECTION_SOUTH;
Ui.getUiEngineInstance.setAcceptableDirections(directions);

See Specifying the orientation and direction of the screen

Max Gontar