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
Forum Updated to NodeBB v4.3 + New Features

Getting location data from GPS in android and ios

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 5.1k 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 21 Nov 2016, 18:53 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 21 Nov 2016, 19:41 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 21 Nov 2016, 20:22 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!

        R 1 Reply Last reply 22 Nov 2016, 07:51
        0
        • V vyau
          21 Nov 2016, 20:22

          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!

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 22 Nov 2016, 07:51 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 22 Nov 2016, 17:03
          0
          • R raven-worx
            22 Nov 2016, 07:51

            @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 22 Nov 2016, 17:03 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 28 Nov 2016, 22:30 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

              R 1 Reply Last reply 29 Nov 2016, 07:28
              0
              • V vyau
                28 Nov 2016, 22:30

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

                R Offline
                R Offline
                raven-worx
                Moderators
                wrote on 29 Nov 2016, 07:28 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

                6/7

                28 Nov 2016, 22:30

                • Login

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