Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QGeoCoordinate altitude is always equals to 0 on android device.
Forum Updated to NodeBB v4.3 + New Features

QGeoCoordinate altitude is always equals to 0 on android device.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qgeocoordinateqgeopositioninfandroid
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • invyI Offline
    invyI Offline
    invy
    wrote on last edited by invy
    #1

    Hi all,

    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,

    Igor

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Carmoneer
      wrote on last edited by
      #2

      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.

      invyI 1 Reply Last reply
      0
      • C Carmoneer

        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.

        invyI Offline
        invyI Offline
        invy
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved