diff options
author | Mathias Agopian <mathias@google.com> | 2010-08-18 12:00:30 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-08-18 12:00:30 -0700 |
commit | a6704d39b31417dc674d3866f43dad4ce3f850b1 (patch) | |
tree | 7a1d866cef6c07bc00983143c8af01e289b321f2 /core/java/android/hardware/SensorManager.java | |
parent | c4554b9a0885ac3713575e91d8d33c5670b52322 (diff) | |
download | frameworks_base-a6704d39b31417dc674d3866f43dad4ce3f850b1.zip frameworks_base-a6704d39b31417dc674d3866f43dad4ce3f850b1.tar.gz frameworks_base-a6704d39b31417dc674d3866f43dad4ce3f850b1.tar.bz2 |
Improve documentation of getAltitude
Change-Id: Ie6c61fa6018e54143cec6e65978df9abb48854d9
Diffstat (limited to 'core/java/android/hardware/SensorManager.java')
-rw-r--r-- | core/java/android/hardware/SensorManager.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java index f6d237a..d2c3eaa 100644 --- a/core/java/android/hardware/SensorManager.java +++ b/core/java/android/hardware/SensorManager.java @@ -1525,7 +1525,22 @@ public class SensorManager * Typically the atmospheric pressure is read from a * {@link Sensor#TYPE_PRESSURE} sensor. The pressure at sea level must be * known, usually it can be retrieved from airport databases in the - * vicinity. + * vicinity. If unknown, you can use {@link #PRESSURE_STANDARD_ATMOSPHERE} + * as an approximation, but absolute altitudes won't be accurate. + * </p> + * <p> + * 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 {@link #PRESSURE_STANDARD_ATMOSPHERE} instead, + * which will give good results considering the range of pressure typically + * involved. + * </p> + * <p> + * <code><ul> + * float altitude_difference = + * getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure_at_point2) + * - getAltitude(SensorManager.PRESSURE_STANDARD_ATMOSPHERE, pressure_at_point1); + * </ul></code> * </p> * * @param p0 pressure at sea level |