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. Getting location data from GPS in android and ios
Qt 6.11 is out! See what's new in the release blog

Getting location data from GPS in android and ios

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 5.5k Views 2 Watching
  • 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.
  • V Offline
    V Offline
    vyau
    wrote on last edited by
    #1

    Hi: I am trying to get my location via mobile GPS and like to use Qt
    to port my app onto both android and ios. Can I read from GPS sensor in those
    mobile platforms directly via QNmeaPositionInfoSource
    (http://doc.qt.io/qt-5/qnmeapositioninfosource.html) or must
    I go through NDK (in Android) and C (in ios) to read from GPS sensor?

    thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Schluchti
      wrote on last edited by
      #2

      I am using PositionSource in my application to receive the current position, which works pretty well. (see example here: http://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html)

      Want to read more about Qt?

      https://gympulsr.com/blog/qt/

      Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

      1 Reply Last reply
      1
      • V Offline
        V Offline
        vyau
        wrote on last edited by
        #3

        thanks.
        I see on the C++ side, there's a complementary API to what you suggested:

        http://doc.qt.io/qt-5/qnmeapositioninfosource.html

        It seems that I can set the source directly to read from GPS sensor by declaring
        a QIODevice(). How do I point to my GPS sensor on the phone using this class?
        I am unclear about this.

        Thanks!

        raven-worxR 1 Reply Last reply
        0
        • V vyau

          thanks.
          I see on the C++ side, there's a complementary API to what you suggested:

          http://doc.qt.io/qt-5/qnmeapositioninfosource.html

          It seems that I can set the source directly to read from GPS sensor by declaring
          a QIODevice(). How do I point to my GPS sensor on the phone using this class?
          I am unclear about this.

          Thanks!

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @vyau said in Getting location data from GPS in android and ios:

          I see on the C++ side, there's a complementary API to what you suggested:
          http://doc.qt.io/qt-5/qnmeapositioninfosource.html

          NMEA isn't want you want, this is just a specific position source - IIRC taken from special formatted text files

          See this

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          V 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @vyau said in Getting location data from GPS in android and ios:

            I see on the C++ side, there's a complementary API to what you suggested:
            http://doc.qt.io/qt-5/qnmeapositioninfosource.html

            NMEA isn't want you want, this is just a specific position source - IIRC taken from special formatted text files

            See this

            V Offline
            V Offline
            vyau
            wrote on last edited by
            #5

            @raven-worx thanks, let me check out your link.

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vyau
              wrote on last edited by
              #6

              @raven-worx Your example works. Do you have any Qt example that leverages Wifi or 4G to determine mobile phone location? Thanks

              raven-worxR 1 Reply Last reply
              0
              • V vyau

                @raven-worx Your example works. Do you have any Qt example that leverages Wifi or 4G to determine mobile phone location? Thanks

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @vyau said in Getting location data from GPS in android and ios:

                Do you have any Qt example that leverages Wifi or 4G to determine mobile phone location?

                No, i am not aware of such feature in Qt yet.
                (But this doesn't mean that it doesn't exists)

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                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