0

Possible Duplicate:
Can I emulate a compass on Android

I'm developing an Android application whose display depends on the orientation (azimuth specifically) of the phone. I'd like to test the application using the Android emulator, and so I need to change the orientation of the emulator dynamically through its telnet interface.

I can change its GPS position by issuing commands of the form: geo fix 34 56

However, I can't work out how to do the same for its azimuth. Is this possible, and if so how?

Thanks for any help, Martin

Community
  • 1
  • 1
user304582
  • 1,910
  • 5
  • 28
  • 49
  • I think this is a duplicate... http://stackoverflow.com/questions/2376512/can-i-emulate-a-compass-on-android – Matthieu Feb 01 '11 at 06:58
  • Thanks - not quite the answer I was expecting or hoping for, but at least I know! I was reduced to moving my PC around to get the emulator orientation to change. – user304582 Feb 04 '11 at 21:23

1 Answers1

0

Its simple .You have to just press ctrl+F11 to change orientation when emulator is running.

Stefan
  • 5,203
  • 8
  • 27
  • 51
chikka.anddev
  • 9,569
  • 7
  • 38
  • 46
  • Hi - thanks but this not what I meant. I do not mean the horizontal/vertical orientation of the phone. I mean the azimuth: this is one of the three values that comes back from the call to the Orientation sensor: – user304582 Feb 01 '11 at 07:05
  • orientationSensor = sensorManager.GetDefaultSensor(SensorType.Orientation); sensorManager.RegisterListener(this, orientationSensor, SensorDelay.Normal);I mean sensorEvent.Values[0] – user304582 Feb 01 '11 at 07:06
  • Sorry - I hit return before completing this comment. I meant, if you have code along these lines: orientationSensor = sensorManager.GetDefaultSensor(SensorType.Orientation); sensorManager.RegisterListener(this, orientationSensor, SensorDelay.Normal); When the listener detects a SensorEvent, then the OnSensorChanged(Sensor sensorEvent) method can retrieve the new azimuth as sensorEvent.Values[0] What I would like to do, if I can, is to make the emulator fire a series of SensorEvents, by using the telnet interface. Is this clearer? – user304582 Feb 01 '11 at 07:12