Orientation Change While Face Up or Fade Down With Magnetometer?

Discussion in 'iOS Programming' started by Darkroom, Jul 15, 2009.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    i assume face up / face down orientation is possible on the new iPhone 3GS devices using the magnetometer and i'd like to know if Apple supplies sample code for this? also, since most iPhone OS devices currently wouldn't support this, is it possible to poll for the device specifically for iPhone 3GS? the UIDevice class notes in the documentation is unclear and only suggests @"iPhone" or @"iPod touch" as possible model strings.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    You can detect face up / face down orientations using just the accelerometer; no need to use the magnetometer. So, you don't need to restrict this functionality to 3GS devices.
     
  3. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    what?! really? i have never seen anything in the documentation concerning this. maybe i wasn't clear with my question. say i have a device that's laying face up on the table. if i turn the device 45º while it is laying face up on the table, the accelerometer will detect this shift and change orientations?
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Oh, that's different. That's not the same as the difference between face up and face down. But it still is possible to detect the movement using the accelerometer, although not the actual heading, from such a change. Usage of the AccelerometerGraph sample app bears this out.
     

Share This Page