The Garmin edge 705 has a barometric altimeter which differ from GPS derived altitudes. (Not sure if those smartphones have a barometric sensors.)
The altitude "cliffs" mentioned above can be sensor blockages or atmospheric changes. If you ride for a while, have an hour pub lunch, then continue riding the conditions could have changed (atmospheric pressure) and it will show as a sudden cliff. Most websites allow "fixing" of elevation using their own topographical maps.
GPS recording is always going to be a "best-guess" effort, the only way to get a precision recording of performance is on a properly timed & measured course. GPS data is also wide open to modification to create fake times & distances. (Search digital EPO)