Android.Hardware.SensorManager.GetAltitude Method
Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level.

Syntax

[Android.Runtime.Register("getAltitude", "(FF)F", "")]
public static float GetAltitude (float p0, float p)

Parameters

p0
pressure at sea level
p
atmospheric pressure

Returns

Documentation for this section has not yet been entered.

Remarks

Computes the Altitude in meters from the atmospheric pressure and the pressure at sea level.

Typically the atmospheric pressure is read from a Sensor.TYPE_PRESSURE sensor. The pressure at sea level must be known, usually it can be retrieved from airport databases in the vicinity. If unknown, you can use SensorManager.PressureStandardAtmosphere as an approximation, but absolute altitudes won't be accurate.

To calculate altitude differences, you must calculate the difference between the altitudes at both points. If you don't know the altitude as sea level, you can use SensorManager.PressureStandardAtmosphere instead, which will give good results considering the range of pressure typically involved.

    [Android Documentation]

    Requirements

    Namespace: Android.Hardware
    Assembly: Mono.Android (in Mono.Android.dll)
    Assembly Versions: 0.0.0.0
    Since: Added in API level 9