locked
How do you tell the difference between a Windows 8 device, and a Windows 8 desktop at run time?

    Question

  • I am currently creating a portrait app. It's going well, but I have run into a problem that I cannot get around. As the app is set to portrait, I can launch it on my surface pro and then the screen will rotate and there; I have my portrait game. It is great! However, when I install the windows store app on my desktop computer running 8.1, it still tries to show the app in portrait which means that it is rotated -90 degrees. That is fine and expected; issue is, I need to present the game in landscape mode in this case, but for the life of me, I cannot find any differences between the surface pro and my desktop computer to check when to make the switch. Both have the same OS, OS version, architecture, ID, chipset, cores, etc. Is there something obvious that I am missing? Any help would be appreciated.

    Thanks!

    Monday, October 06, 2014 11:11 AM

Answers

  • Hi

    Have you declare Visual States of your app ?

    If not then declare Visual States of your App different devices 

    Further following articles  will also help you

    http://marcominerva.wordpress.com/2013/10/16/handling-visualstate-in-windows-8-1-store-apps/

    http://irisclasson.com/2013/12/16/visualstates-and-the-missing-snapped-mode-made-easy-in-windows-store-apps/


    Monday, October 06, 2014 11:34 AM
  • Hi jamielliottg,

    Well, the biggest problem is desktop does not have any sensor, for instance when you portrait your screen, without a specific setting, your app cannot recognize it. But for a device, the orientation of the screen will be detected while you oriented the device.

    Let's back to your question, try to select those things while you are trying to detect the screen orientation.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, October 20, 2014 7:36 AM
    Moderator

All replies

  • Hi

    Have you declare Visual States of your app ?

    If not then declare Visual States of your App different devices 

    Further following articles  will also help you

    http://marcominerva.wordpress.com/2013/10/16/handling-visualstate-in-windows-8-1-store-apps/

    http://irisclasson.com/2013/12/16/visualstates-and-the-missing-snapped-mode-made-easy-in-windows-store-apps/


    Monday, October 06, 2014 11:34 AM
  • Hi jamielliottg,

    Well, the biggest problem is desktop does not have any sensor, for instance when you portrait your screen, without a specific setting, your app cannot recognize it. But for a device, the orientation of the screen will be detected while you oriented the device.

    Let's back to your question, try to select those things while you are trying to detect the screen orientation.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, October 20, 2014 7:36 AM
    Moderator