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

Adobe AIR Development

Reply
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700
Accepted Solution

Screen Orientation: Simulator vs. Actual Device

Hey Guys (and Gals),

 

So yesterday when we first got the SDK me and harry noticed an orientation issue. To be honest I couldn't even rotate the device in the simulator (later found out about the click and drag). Anyways, my current app was being built assuming we wouldn't see any rotation capabilities in the simulator till later. But now that we received the updated simulator we can finally do some rotation tests. So here is what we observed:

 

After adding the following lines to the -app.xml file:

 

 

<autoOrients>false</autoOrients>
<aspectRatio>landscape</aspectRatio>

 

 

I compile and run my application in debug mode into the simulator. Runs without a hitch. I do the click and drag motion to rotate the simulator. Doesn't work. Now I am going to assume that this happens because I set the autoOrient value to false. So now so far so good. If the user decides to rotate the device while using my app it'd stay the same (i was planning on doing the portrait mode edits later).

 

so what's the problem. After I swipe up on my application to minimize it while still in landscape mode it shows up as a normal horizontal app. Now if I were to do the click and drag motion to rotate the simulator the simulator rotates - but not my app. Now because it was rotated while being minimized my app is still assuming the device is in landscape mode and remains the same form. Now when i maximize my app while still in portrait mode it looks pretty bad to say the least. a landscape app in portrait form factor - not a pretty picture.

 

In case I have anyone scratching their heads, here are steps to re-create (this is all assuming your app is set to only show in landscape mode):

 

  1. Make a wonderful app
  2. Put the above lines of code into your -app.xml file to prevent orientation change.
  3. Compile and Run / Debug your app on the simulator
  4. Assuming your simulator didn't freeze (har har :smileyhappy:) try to rotate the screen.
  5. After finding out you are not able to rotate the screen, minimize your app with a swipe up.
  6. Now rotate your simulator via the drag and rotate motion (lower right hand corner into the middle of screen)
  7. Now take notice of how your minimize app looks.
  8. Maximize your landscape only app.
  9. Cringe.

If you followed those steps in that order you should be able to now understand if you didn't already before.

 

so my question is, is the same behaviour expected from the actual device? or will a minimized landscape only application be rotated to still be in "landscape" mode and not stretched to fit portrait mode?

 

Thanks for any information / suggestion / collaboration effort in advance!

 

(btw while typing this a workaround came to mind where i could check to see the current ratio of height and width of the stage and do the orientation myself - i'll keep you posted!)

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 85
Registered: ‎10-25-2010
My Device: Not Specified

Re: Screen Orientation: Simulator vs. Actual Device

Hey,

i believe the same workaround is shown in this video:

http://vimeo.com/18737106

Seems like a BB issue to me so let's hope they fix these soon :smileyhappy:

Hope this helps,
Fabien

--
1. If you liked my post or found it useful please click on the white star and provide a Kudo!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Screen Orientation: Simulator vs. Actual Device

hey fnicollet,

 

thanks for the reply and link! i didnt realize there was already a thread about this (still cant find it). must've been lost in the slew of threads from yesterday's revealing of the new SDK haha. i did the work around shown in the video before but the problem remains that half my application is cutoff once maximized. i assumed it'd be rotated to preserve the original layout.

 

what i have tried was detect the rotation and rotate the entire application, however, what i came to realize (and was kind of already fearing it would happen) is since my fonts are not embedded, they will not show up once rotated.

 

so my choices are wait for the fix, create a portrait version of my app, or embed the fonts and see where that leads (seems like a dark alley haha).

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 85
Registered: ‎10-25-2010
My Device: Not Specified

Re: Screen Orientation: Simulator vs. Actual Device

Same here, i'm just going to wait. It's working perfectly in Android (sim and device) so there i'm not going to write code to fix something that will be fixed when it will be released (they can't leave it like that)

Hope this helps,
Fabien

--
1. If you liked my post or found it useful please click on the white star and provide a Kudo!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Screen Orientation: Simulator vs. Actual Device

ah ok. just to confirm what you said, so on androids if you do the landscape lock in via -app.xml as described above, it will keep your application laid out as it was orginally if the device is rotated? meaning your app is rotated but still remains unchanged, undistorted, and full screen?

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 85
Registered: ‎10-25-2010
My Device: Not Specified

Re: Screen Orientation: Simulator vs. Actual Device

Yup that's right

Hope this helps,
Fabien

--
1. If you liked my post or found it useful please click on the white star and provide a Kudo!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!
Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Screen Orientation: Simulator vs. Actual Device

Very cool. So then im going to let this slide to the back of my mind for now and can continue with core functionality. thanks again fnicollet!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman