×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    detect orientation mode after using setOrientation function

    hello,

    i got a task to display a warning message on phones like N95 are switched to lanscape mode by sliding the device.
    but i need to force my application to portrait mode at the same time.

    this is what i did

    first i display message

    if (iEikonEnv->EikAppUi()->ApplicationRect().Width() > iEikonEnv->EikAppUi()->ApplicationRect().Height())
    {
    DisplayMessageL.........
    }
    then do
    SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait);

    but the message come only when the first time i swtich the orientation mode.

    can anyone help me with this is there another way to detect orientation mode after using setOrientation function.

    thanks

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: detect orientation mode after using setOrientation function

    i tried to check with

    if (iEikonEnv->ScreenDevice()->SizeInPixels().iWidth > iEikonEnv->ScreenDevice()->SizeInPixels().iHeight)
    {
    DisplayMessageL.....
    }

    got the same result

  3. #3
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: detect orientation mode after using setOrientation function

    hav you tried Orientation() fucntion already ?

  4. #4
    Nokia Developer Moderator
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,347

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: detect orientation mode after using setOrientation function

    Thank you for the answer

    i have successfully set the orientation mode to portrait, that was not my problem.

    my problem is:

    I need to display a message in landscape mode. Since i have forced the orientation to portrait, the question now is how can i detect i am in portrait or landscape after i forced my app always to portrait?

    by check width/height is not possible because when i forced my app always to portrait width always < height

    is there some other parameters can tell if i am in portrait or landscape mode?

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: detect orientation mode after using setOrientation function

    i also used HandleResourceChangeL( aType );

    in other word i catch the event successfulyy, the i need to check the orientatio mode inside HandleResourceChangeL( aType );
    this is what i have
    void CMobNavBaseContainer::HandleResourceChange(TInt aType)
    {
    switch(aType)
    {
    case KEikDynamicLayoutVariantSwitch:
    if (iEikonEnv->ScreenDevice()->SizeInPixels().iWidth > iEikonEnv->ScreenDevice()->SizeInPixels().iHeight)
    {
    DisplayMessage,,,,, }

    AppUi()->SetOrientationL(CAknAppUiBase::EAppUiOrientationPortrait);
    break;
    }
    }

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: detect orientation mode after using setOrientation function

    it comes to display message only for the first time i switch to lanscape.

  8. #8
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: detect orientation mode after using setOrientation function

    You could maybe try checking What ApplicationRect() would give you..

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Unhappy Re: detect orientation mode after using setOrientation function

    Quote Originally Posted by symbianyucca View Post
    You could maybe try checking What ApplicationRect() would give you..
    i did

    i tried

    if (iEikonEnv->ScreenDevice()->SizeInPixels().iWidth > iEikonEnv->ScreenDevice()->SizeInPixels().iHeight)

    and

    if (iEikonEnv->EikAppUi()->ApplicationRect().Width() > iEikonEnv->EikAppUi()->ApplicationRect().Height())

    got the same result

  10. #10
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Unhappy Re: detect orientation mode after using setOrientation function

    can anyone give me a hint.i have spend a lot of time on this problem without any progress

  11. #11
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: detect orientation mode after using setOrientation function

    Hi,

    You can use the Sensor API to get the current phone orientation.

    "Sensor API example"
    http://library.forum.nokia.com/index...doc/index.html

    Regards

    Ziteng Chen

  12. #12
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,142

    Re: detect orientation mode after using setOrientation function

    The Orientation() gives it better, sinc eit tells the applications orientation. Anyway, the orientation change takes time, so you need to wait untill it is done untill you check what the screen size is.

  13. #13
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Unhappy Re: detect orientation mode after using setOrientation function

    Quote Originally Posted by symbianyucca View Post
    The Orientation() gives it better, sinc eit tells the applications orientation. Anyway, the orientation change takes time, so you need to wait untill it is done untill you check what the screen size is.
    thanks
    i tried Orientation() , i always get AppUi()->Orientation() is CAknAppUiBase::EAppUiOrientationPortrait

  14. #14
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Unhappy Re: detect orientation mode after using setOrientation function

    Quote Originally Posted by chenziteng View Post
    Hi,

    You can use the Sensor API to get the current phone orientation.

    "Sensor API example"
    http://library.forum.nokia.com/index...doc/index.html

    Regards

    Ziteng Chen
    thanks
    but i am using FP1,
    Last edited by Zhuwei; 2009-09-08 at 15:49.

  15. #15
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: detect orientation mode after using setOrientation function

    maybe another way to describe my problem

    I force the Orientation mode to portrait, ´
    then i need to check if the user switch the device to landsape side or not.

    i can#t get the information because after i force the Orientation mode to portrait all possible information are in portrait mode. i can#t detect user action any more.

    :((
    Last edited by Zhuwei; 2009-09-08 at 15:26.

Page 1 of 2 12 LastLast

Similar Threads

  1. Nokia 5800 XpressMusic accerated video decoders
    By Gingah in forum General Development Questions
    Replies: 4
    Last Post: 2009-07-06, 17:44
  2. Ways to detect if widget is running in miniview mode?
    By onur_ersen in forum Symbian Web Runtime
    Replies: 4
    Last Post: 2009-05-18, 09:45
  3. How to detect standby mode in 3650?
    By Utk in forum Symbian C++
    Replies: 0
    Last Post: 2004-06-08, 15:23
  4. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •