views:

986

answers:

1

I'm working with the mobile graphic framework LWUIT (V. 1.2) to develop an application for Nokia N97.

Results are striking and elegant but I have a problem: when I rotate mobile screen, menu bar doesn't switch from bottom to the right of screen. Commands remain on the bottom while correspondent mobile buttons are now on the right...

Is there an event that I can intercept when the user open or rotate mobile screen? Or I have to extend some library class to make this behaviour automatic? Or anithing else?

Anyone of you can describe a solution?

Thanks in advance

A: 

I didn't use LWUIT much, but you can insert following parameter to jad:

Nokia-MIDlet-App-Orientation: portrait

This should disable auto-rotating on Nokia S60 5th.

If you want to catch an event when the screen rotates, you can check canvas.getWidth() and canvas.getHeight(). If device's screen is not square, its width and height should change.

Pavel Alexeev
Many thanks for your responce Pavel. I already evaluate your solution, but I need something else. The parameter on .jad fixes screen ratio on portrait when I rotate screen too. Instead screen ratio must change and menu bar should be displayed vertically on the right side...Screen rotation does not generate any event so the only one solution I can think to is a parallel thread that at regular intervals check screen dimensions...
Merlyn