First: barometers are very accurate, but inaccurate. If you place 10 Android phones next to each other on the table, you can find barometric pressure differences up to 3 mb between devices. This is one of the sources of errors.
Second: different groups will define "height" differently, so make sure you use the same definitions. For example, in the Location class, getAltitude is defined as
Get the height, if available, in meters above the WGS 84 reference ellipsoid.
http://developer.android.com/reference/android/location/Location.html#getAltitude ()
Thirdly, the weather will affect the reading of the barometer up to 40 mb. If you want a more accurate elevation from the barometer, you will have to compensate for the current weather. The atmosphere can change local pressure up to 1-2 mbar per hour (in extreme cases)
Fourth: it is not yet possible to obtain an absolutely accurate height value using a barometer in a smartphone. No one has decided this yet - just a barometer is not enough to detect the floor level, for example.
Iβm a PressureNet developer, by the way, I have collected over 2 billion pressure readings from smartphones, and I see all these types of errors every day.
In conclusion: the readings that the barometer delivers to you require significant interpretation before use if you want to achieve a "height" value. Each value that is read from each barometer is erroneous by default; You will need to do some work to make it work for you, depending on your specific needs.
github.com/cbsoftware/pressurenet
source share