True North on Android (event.geographic)

Is event.geographic supported on android in recent builds.

Please do check the android SDK:
http://developer.android.com/reference/android/hardware/GeomagneticField.html#getDeclination()

The getDeclination method calculates the geometric north from the magnetic north.

Thank you. [import]uid: 53864 topic_id: 12926 reply_id: 312926[/import]

Check out the Corona SDK’s sample app “Hardware\Compass”. Also check out our API documentation on “Heading” events via the link below. I think that is what you are looking for.
http://developer.anscamobile.com/content/heading-compass
[import]uid: 32256 topic_id: 12926 reply_id: 47803[/import]

Oh… but that said, the heading event does not give you declination. [import]uid: 32256 topic_id: 12926 reply_id: 47804[/import]

From the docs: Android OS only supports event.magnetic, not event.geographic.

Without the declination I cannot implement a true compass that would point to a certain location on Android. [import]uid: 53864 topic_id: 12926 reply_id: 47833[/import]

Corona uses Sensor.TYPE_ORIENTATION on Android for its “Heading” event, not Sensor.TYPE_MAGNETIC_FIELD. Sensor.TYPE_ORIENTATION measures azimuth, pitch, and roll in respects to the Earth. Corona’s “Heading” event provides azimuth. Please see the following link…

http://developer.android.com/reference/android/hardware/SensorEvent.html#values
[import]uid: 32256 topic_id: 12926 reply_id: 47882[/import]

You are describing the problem, Corona only provides the azimuth on Android.
It should also be able to provide the true north by using:
http://developer.android.com/reference/android/hardware/SensorManager.html#getInclination(float[])

This is why we are moving the current development of the project on android away from Corona until such a feature exists.

[import]uid: 53864 topic_id: 12926 reply_id: 48127[/import]