locked
Sensor Events

    Question

  • Hello, I am working on an app that will have a specific layout that is determined by the users current screen orientation. So far I've designed the layout by the standard landscape view. I am hoping to be able to somehow test the event listener without an actual tablet. The simulator does not seem to create an event. I would hate to just assume that the event triggers and my code restructures the screen. Any ideas?
    Sunday, January 15, 2012 11:23 PM

All replies

  • Are you explicitly listening to the sensor or do you just need help with how to deal with layout events when switching between portrait and landscape modes?

    If the latter, which UI platform are you using? HTML? Xaml? DirectX?

    The simulator does switch between portrait and landscape and should provide appropriate layout events. It does not simulate the actual sensors though.

    --Rob

    Tuesday, January 17, 2012 7:15 AM
    Owner
  • yes, I have no issues with the layout, I just don't have an actual device to test the orientation trigger events. I wrote my code and routines to handle the events to redraw the screen. I just don't like the idea of assuming that my code works. Does Microsoft have a solution for full Metro App testing?
    Wednesday, January 18, 2012 5:01 AM
  • The simulator switches between portrait and landscape mode and will trigger the appropriate orientationchanged events, so you can test in that.

    If you are actually using the sensor API directly then you'll need a system with the sensor to test on.

    --Rob

    • Proposed as answer by fern johnson Friday, January 20, 2012 1:32 AM
    Friday, January 20, 2012 12:59 AM
    Owner
  • thanks for the reply, however, I have tested in the simulator with no luck. Maybe i'm listening to the incorrect event as I switch the layout, but my app is not getting the trigger. I am using JavaScript.
    Friday, January 20, 2012 8:17 PM
  • I'll move this to the JavaScript forum for you so you can get help on which events to look for in that framework.

    --Rob

    Friday, January 20, 2012 8:45 PM
    Owner