Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Champion mariozorz's Avatar
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24
    Hi all,

    I'm working on a project that needs the orientation to stay in
    "portrait" mode but let the user move the phone to the "landscape" position
    only when text input is needed.

    So, the idea is, the app remains in portrait mode until the user needs to
    input some text. We're using LWUIT's TextArea component for this so we
    thought there was a possibility to lock LWUIT to portrait and only use
    landscape for the native Textbox implementation when it shows up, but we're
    finding it difficult to prevent LWUIT from switching orientation.

    Our target handsets are Nokia touchscreen devices (S60 5th edition particularly, i.e. 5800, 5230, X6,etc), so the
    "Nokia-MIDlet-App-Orientation: portrait" JAD attribute pretty much did the
    trick except for the native keyboard not being displayed in landscape
    orientation this way - which is exactly what we need to do: 1) show the app
    in portrait at all times 2) allow the native keyboard as implemented by
    native TextBox implementation to be shown in landscape when text input is
    required.

    Any ideas are apprecitated!

    Thanks in advance

    Mario

  2. #2
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    define your own Custom Keyboard and TextBox for this need, do not depend on native - it will be locked to Portrait with "Nokia-MIDlet-App-Orientation: portrait" - JAD.
    thanks,
    ~Amitabh
    (Poster of the Month -Dec'12)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Nokia Developer Champion mariozorz's Avatar
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24
    Thanks ~Amitabh

    The thing is I'm using LWUIT and it handles sizeChanged() events to switch orientation and it seems I can't prevent it from doing so (unless we change LWUIT's source code which we are trying not to).
    So basically, when you rotate the phone you have to be aware of this as the coordinate system changes, but you are only notified about the Canvas size change via a call to sizeChanged(). The you need to detect and assume this is an orienation change by realizing the width and height have been interchanged (i.e. 360x640 changes to 640x360). Now the touch events will have a different coordinate system which we'd also need to tweak.

    So, to sum up, if I were to code my own custom keyboard or textbox, I'm in the same problem: the sizeChanged wouldn't ever be fired if the JAD attribute is set. And if we don't set it, then the sizeChanged events get fired but we need to tweak LWUIT code to handle both painting and the coordinate system.

    What do you think?

    Thanks for the advise
    Mario

  4. #4
    Nokia Developer Champion im2amit's Avatar
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    2,903
    You should fix the device orientation, and make a custom text field that always opens the keyboard in landscape mode [which you draw on Canvas and have the co-ordinate matrix in place to identify which key is pressed by touch event].
    thanks,
    ~Amitabh
    (Poster of the Month -Dec'12)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Help: how to use WRT only in Portrait mode?
    By gomcoite in forum Symbian Web Runtime
    Replies: 3
    Last Post: 2011-02-18, 22:55
  2. Replies: 2
    Last Post: 2010-12-03, 11:32
  3. How to use Layouts in Qt Creator for Portrait and Landscape modes?
    By Sasler in forum [Archived] Qt SDKs and Tools
    Replies: 7
    Last Post: 2010-09-13, 17:14
  4. Portrait to Landscape Switching on N63
    By hassan.imtiaz in forum Symbian C++
    Replies: 8
    Last Post: 2009-08-07, 09:14
  5. Replies: 2
    Last Post: 2009-06-05, 07:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved