I am developing application using J2ME and LWUIT.I want to run this application on landscape mode only. For Nokia there is an attribute : Nokia-MIDlet-App-Orientation: landscape but for other device , What is the attribute to restrict the application to landscape mode only? How to achieve this for different J2ME devices?
相关问题
- LWUIT: How to show menu commands with another butt
- How to allow both landscape/portrait for tablets o
- Unexpected JDWP Error 21
- Android - detect reverse landscape orientation
- Receive text message using J2ME
相关文章
- How to prevent Screen Orientation change when Acti
- Button Image Problem
- What unit-test frameworks would you recommend for
- Android splash screen for both landscape and portr
- SQLite for BlackBerry
- Loading image in Java J2ME
- Negative Array Size Exception
- How to restrict j2me application in the Landscape
I check the method Display.canForceOrientation() this give you the wrong answer because the value in the LWUITImplementation.java is hard coded and always return false. So in LWUIT if we want to restrict application the only way to do this is to add a JAD attribute through code it not possible.
If you want to lock the screen orientation in LWUIT, you must use a combination of the following methods.
Display.isPortrait()
Returns true if the device is currently in portrait mode.Display.canForceOrientation()
Returns true if the device allows forcing the orientation via code, feature phones do not allow this although some include a jad property allowing for this feature.Display.lockOrientation(boolean portrait)
On devices that return true for canForceOrientation() this method can lock the device orientation either to portrait or landscape modeI hope this can help you.
Following is the attribute to restrict application in landscape mode only.
Nokia device:
Samsung device: