In the past, I have resisted using the barometric pressure sensor present in most recent high-end phones for a variety of reasons:
- there is no high-level Android API to reliably get altitude information (in particular I would have expected an API that processes data from all available sensors to mitigate the inaccuracy and drift of each)
- without such an API, a manual calibration is required, which is intrusive (especially since it needs to be repeated at regular intervals)
I have finally let myself be convinced that the GPS altitude is a poor substitute (because it’s noisy and imprecise) for an altimeter, and I have done my best to make the calibration process as unobtrusive as possible.
If your device has a barometric pressure sensor, it will automatically try to record your pressure-derived altitude. Once the GPS has a fix, MyTrails will try to get sensible defaults to help calibrate the altimeter: it looks up the ambient temperature and altitude from an online service if you are connected, or it uses the GPS altitude and temperature from your phone if it has one.
It then creates a notification to ask you to perform the calibration; you don’t have to do it immediately, so you can wait until you reach an altitude sign or a reference altitude on the map. You can tweak the values (temperature is not too important) and calibrate. MyTrails will use the calibration to set altitudes based on already-recorded pressure data, and use until the next time you calibrate (MyTrails will remind you to update the calibration at regular intervals).
New stats have been added (and can be shown on the HUD), and the altimeter-derived altitude can be graphed.
I need to tweak how altitudes are stored in exported GPX, and used for calculations and colorization, so that when the altimeter is used when it is calibrated, but the GPS is used as a backup.