How do I map the device Y axis to the screen Y axis? I can't figure this out.
I'm the developer of Tricorder, and I'm trying to make it so that the accelerometer and magnetometer indicators I draw always point in the right direction. On the G1 phone with the slider closed, all is well. But when I open the slider, I end up showing that gravity is pulling me to the left (if the phone is held with the display vertical). So, I know that the device, and hence sensor, Y axis is always in the direction of the earpiece; and the screen Y axis changes when I open the slider. And I know that I can use remapCoordinateSystem() to change the device axes to match the screen axes. But where do I find out what the device's orientation is? In other words, how do I compute the correct values for the X and Y parameters to remapCoordinateSystem()? Configuration.orientation seems quite useless. Suppose it is set to LANDSCAPE. What does this mean? Does it mean a device which is "naturally" portrait (i.e. the sensor Y axis points to the narrow end), and which has been turned into landscape mode? If so, which way was it turned? Or does it mean a device which is naturally landscape? In other words, LANDSCAPE could mean that the screen axis is off from the sensor axis by +90, 0, OR -90 degrees. Not much help. So how do I do this? Obviously I want my app to work on all devices, not just the G1 phone. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

