Is there an Android equivalent of didUpdateHeading (from iOS) ? Any sample code to rotate the mapview using it?
Searched a lot, but couldn’t get a helpful hint.
Thanks in advance.
Edit: Let me expalain my question: In IOS, when the device changes its Heading, delegate object gets a call on its method: “didUpdateHeading”. In Android I could find “onLocationChanged” to get the coordinates, but no Heading information. How do I get the heading information in Android?
Source: http://android-er.blogspot.com/2010/08/simple-compass-sensormanager-and.html
http://developer.android.com/reference/android/hardware/SensorManager.html
Should be what you’re looking for. The
OnSensorChangedmethod should provide the same functionality.(float)event.values[0]is your heading.Just read your bounty text. This is the only way to do it, from everything I’ve researched, and from my experience in general. The example I provided will give you what you need fairly quickly with copy & paste, however.