Adapt screen to an orientation change

Hi
I have seen in the docu that there is a property to react to an screen rotation.
project.handset.adapttoorientationchange
Platforms BREW, iOS, Windows Mobile
Options “true” / “false”
Default “false”
Set this to true if the application should rotate its display if the device’s screen is rotated. If set, the corresponding rendering

inside the graphics library will change, the values fed back from

Android should trigger a canvas rotation automatically when reading the doc for property:
android.orientation.forced

Testing with an Android emulator I see that nothing happens
Picture (Device Independent Bitmap) Picture (Device Independent Bitmap)

How do I catch such an event? Do I need to set additional properties for this?

Many thanks
Javier

Hi Javier,

None of the NativeUI implementations currently support this - previous non-NativeUI apps would work with this fine.

It’s on the to-do list, but requires a bit of an internal discussion as there’s obviously an impact on any application that tries to lay out its display based on exact pixel positions and then is subsequently rotated.

Regards,

Nick.

hi
when you say that pre-NativeUI apps worked fine, means that the event was captured somehow.
Is it not possible to capture this event in a NativeUI app? I want to refresh the whole view anyway (to display some more columns in a table).

Can you say anything about when can we expect this to be ready? Screen rotation is something i (as a mobile dev beginner) would take for granted in a mobile app.

many thanks
Javier

Hi Javier,

Yes, in the MIDP specification the Canvas has a simple “sizeChanged”
event which pre-NativeUI apps could utilise and would work as required,
and our runtime abstraction layer also dealt with. For NativeUI, the
implications of this haven’t been implemented yet. Re. timescale, I’m
not sure currently, but I imagine it will be one of the earlier NativeUI
enhancements we’ll look at once things like J+ are out the way.

Regards,

Nick.

Given that the documentation you pasted below indicates that it’s supported on BREW, iOS, and Windows Mobile, I would assume it wouldn’t do anything on Android anyway.

And given the complexities in rebuilding a screen with a completely different size/shape, automatic canvas rotation would require a completely different set of Windows/Views/and/or Pages to be defined.

Of course, simply having an event we could detect when the screen was rotated might be helpful regardless. But I’d expect that as part of the formal NativeUI support Nick mentions is on the roadmap.

Dave