Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
KraKra
Posts: 220
Registered: 08-11-2010
Accepted Solution

How to determine if device supports portrait / landscape views ?

Is there an easy way to determine if device screen supports portrait / landscape views ? 

(We need this in order to provide different settings to user)

 

Until recently we used check similar to this one:

 

if OS >= "6.0" && AccelerometerSensor.isSupported()

 

but this code fails on the new Bold  9900 (which has  Accelerometer, but does not have landscape mode).

 

We are looking for solution which does not invlove checking device models manually ...

 

Thanks in advance ! 

 

 

 

 

Please use plain text.
Developer
pradeep_ch
Posts: 378
Registered: 12-23-2010
My Carrier: Airtel

Re: How to determine if device supports portrait / landscape views ?

Hi ,

 

Generally the devices which support TouchScreen are have both the modes.

So that you can go with TouchScreen.isSupported()

 

Thanks.

Please use plain text.
Trusted Contributor
KraKra
Posts: 220
Registered: 08-11-2010

Re: How to determine if device supports portrait / landscape views ?

> So that you can go with TouchScreen.isSupported()

 

Does not work - example Bold 9900 

Please use plain text.
Developer
pradeep_ch
Posts: 378
Registered: 12-23-2010
My Carrier: Airtel

Re: How to determine if device supports portrait / landscape views ?

Then you can try with both the combinations of screen resolution and TouchScreen.isSupportrd().
Please use plain text.
Trusted Contributor
KraKra
Posts: 220
Registered: 08-11-2010

Re: How to determine if device supports portrait / landscape views ?

> Then you can try with both the combinations of screen resolution and TouchScreen.isSupportrd().

 

Thank you for your continiues offer to help us.

 

Do you have in mind a reliable solution which will work on current set of BlackBerry devices and (hopefully) new models ?  

 

On first glance your suggestions is much worse then checking device model directly.

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How to determine if device supports portrait / landscape views ?

don't know a solution myself, and as it is a good question i've escalated it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Administrator
MSohm
Posts: 11,465
Registered: 07-09-2008
My Carrier: Bell

Re: How to determine if device supports portrait / landscape views ?

You can use the DeviceCapability.isRotationSupported() method to determine this.  This class was added in BlackBerry Device Software version 6.0.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Developer
precisionpete
Posts: 257
Registered: 10-05-2010

Re: How to determine if device supports portrait / landscape views ?

Is there a workaround to do this for OS5? What are the underlying parameters that the OS6 API polls?

Please use plain text.
Developer
simon_hain
Posts: 10,780
Registered: 07-29-2008
My Carrier: O2 Germany

Re: How to determine if device supports portrait / landscape views ?

as all acceleratometer devices with 5.0 support it there is no need for a separate check.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

peter_strange wrote:
"This process should happen traumatically for you in both JDE and Eclipse."
Please use plain text.
Developer
precisionpete
Posts: 257
Registered: 10-05-2010

Re: How to determine if device supports portrait / landscape views ?

Except that some later devices do not. e.g. 9900. So a check is needed.

 

I'm trying to avoid building apps for specific devices and OSs. I want to build to a minumum OS and let later devices use that. It's a lot less work.

Please use plain text.