Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGeoCoordinate altitude is always equals to 0 on android device.
invy last edited by invy
I am developing an application for Android using Qt, which at some point should use GPS elevation data.
Just like described in the documentation (and shown in examples), I create QGeoPositionInfoSource using createDefaultSource method, then I connect a positionUpdated signal to receive updates.
The problem is, that on the simulator and on an actual device I receive only latitude and longitude, but the altitude value of the QGeoCoordinates object is always equals to 0.
When I'm using my own QGeoPositionInfoSource, which reads gpx files, I receive correct altitude values.
I've tried to set preferred positioning method using setPreferredPositioningMethods() to SatellitePositioningMethods with no success.
Am I doing something wrong? Do you have any Ideas?
Just for clarification: my android device does support GPS and it's configured to use it. All other apps are able to receive correct altitude values. For simulator I load the gpx file with correct altitude values. (Actually, the same file, that I use in my QGeoPositionInfoSource)
Thank you in advance,
Carmoneer last edited by
This is not a solution, but more of a heads up. Android emulators have a history of bugs in relation to passing altitude values. The issue may not be with your code, but rather the emulator itself. I would be interested to know if there is a resolution as well.
invy last edited by
@Carmoneer Hmm. I've tested my application once again on my device, and I got correct altitude values. Thank you for an advice.
I only wonder, why it didn't work when I've tested this last time.