If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Developer
hpedroza
Posts: 22
Registered: ‎10-30-2008
My Device: Not Specified

Storm orientation problem - using BlackBerryCanvas

Hello, I'm using setAcceptableOrientation(...) to force screen mode to PORTRAIT.

 

The app renders in PORTRAIT mode and wil stay in PORTRAIT ignoring any subsequent tilts which is what we need.

 

However, if the application is started while the phone is in LANDSCAPE mode, canvas will paint in landscape mode until the phone is tilted to PORTRAIT mode at least once.

 

I would like the app starting in PORTRAIT mode ignoring the orientation of the device when app started.

 

Any suggestions?

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Storm orientation problem - using BlackBerryCanvas

[ Edited ]
This issue has been forwarded to our development team.  Thank you for reporting it.
Message Edited by MSohm on 12-09-2008 12:34 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
gladiator430
Posts: 9
Registered: ‎12-17-2008
My Device: Not Specified

Re: Storm orientation problem - using BlackBerryCanvas

Hi,

 

could you tell how do you fixed the orientation in one mode like portrait as i am developing a game which uses SuperCanvas class for all displays and I am using the netbeans software to develop a game. could you send me the code example how to disable the landscape mode.

 

thank you

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Storm orientation problem - using BlackBerryCanvas

You can obtain a DirectionControl object from the Display class and then call the setAcceptableScreenDirections to specify the orientations your application supports.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
garr
Posts: 1
Registered: ‎07-21-2009
My Device: Not Specified

Re: Storm orientation problem - using BlackBerryCanvas


MSohm wrote:
This issue has been forwarded to our development team.  Thank you for reporting it.
Message Edited by MSohm on 12-09-2008 12:34 PM

 

Hi can anybody please confirm if this reported problem has been resolved, and if so, in what device software version the problem was resolved?

 

In particular, I am referring to the application always starting in the orientation that the device is currently displaying when using a J2ME canvas, regardless of how you have DirectionControl.setAcceptableScreenDirections configured.

 

Regards

 

Gareth

 

 

Please use plain text.
Developer
arhimed
Posts: 51
Registered: ‎04-19-2009
My Device: Not Specified

Re: Storm orientation problem - using BlackBerryCanvas

Hi, all!

 

I'd also like to know if this issue is already fixed or not (if yes then in what software version). Let me know, please.

 

Thanks in advance!

Please use plain text.
New Contributor
suhinini
Posts: 2
Registered: ‎06-29-2010
My Device: Bold 9550
My Carrier: Nexus

Re: Storm orientation problem - using BlackBerryCanvas

Hi, Mark

 

Are there any news about this issue? Two years have passed and still no reply. I experience this problem in Blackberry 4.7 emulator and it's really annoying. Was it fixed in 5.0?

 

Thanks,

Ivan Suhinin

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Storm orientation problem - using BlackBerryCanvas

This has been fixed in 5.0.  I tried this in a BlackBerry smartphone simulator running version 5.0.0.535 and it worked correctly.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Contributor
suhinini
Posts: 2
Registered: ‎06-29-2010
My Device: Bold 9550
My Carrier: Nexus

Re: Storm orientation problem - using BlackBerryCanvas

Thanks, that was very useful.

Please use plain text.
New Developer
maratm
Posts: 12
Registered: ‎03-19-2009
My Device: Not Specified

Re: Storm orientation problem - using BlackBerryCanvas

Hi Mark,

 

I'm not sure that issue has been fixed ... It's still there .. (5.0 & 6.0)

 

Currently ,I am in process of migration of m y code to work with Tiltable devices (like Storm , Torch etc.).

As a temporary fix, I've tried to force a user to use our application in PORTRAIT mode only , by calling either :

 // Works only in OS 50 
  this.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT);
                     or
// 4.7 & UP
  net.rim.device.api.ui.Ui.getUiEngineInstance().setAcceptableDirections(Display.DIRECTION_PORTRAIT);  in a constructor of my class, which is an extention of UiApplication class.  (of course before pushing any screen)

 

Both API's call have the same result ...  When user is holding Storm or Torch device in Portrait mode and trying to run an application for first time, every thing is perfect ... no complains and it works as expected ...  An application stays in the initial mode (portrait) when user tries to tilt it to landscape possition.  

 

But .. when user decides to run the same application for a first time in a Landscape mode .. then it looks like both of these API's don't work properly .... for all screens . It looks like device partially ignored setAcceptableDirections call

 

 So it keeps a device orientation in Portrait mode , but all screens are still in Landscape mode ... (all screens classes are extension of net.rim.device.api.ui.container.MainScreen).

 

Thank you,

 

Marat

Please use plain text.